diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-04-10 14:22:30 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-04-10 14:22:30 +0000 |
| commit | 6c2d743aed2eb4c0a960edaadc7366faa3b24c5c (patch) | |
| tree | b41f82e9b41c48e9dcb1cc59833dff26e88817d7 /include/cppunit/ui/mfc | |
| parent | 0e44bc8d5fa467b9d1c835b2e40b17f538e4bbe3 (diff) | |
| download | cppunit-6c2d743aed2eb4c0a960edaadc7366faa3b24c5c.tar.gz | |
Include/cppunitui/: moved to include/cppunit/ui (fix unix install problem).
include/cppunitui/: moved to include/cppunit/ui (fix unix install problem).
* doc/cookbook.dox:
* examples/cppunittest/CppUnitTestMain.cpp:
* examples/msvc/CppUnitTestApp/HostApp.cpp:
* examples/msvc/HostApp/HostApp.cpp:
* examples/qt/Main.Cpp:
* examples/src/cppunit/TestRunner.cpp:
* examples/src/msvc6/TestRunner/TestRunner.cpp:
* examples/src/qttestrunner/TestRunner.cpp: updated to use <cppunit/ui/...>
instead of <cppunitui/...> in include directives.
* doc/CppUnit-win.dox: generated documentation give the include path at the
bottom of the page for each class.
* NEWS: added compatibility break for 1.7.10 users.
Diffstat (limited to 'include/cppunit/ui/mfc')
| -rw-r--r-- | include/cppunit/ui/mfc/TestRunner.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/include/cppunit/ui/mfc/TestRunner.h b/include/cppunit/ui/mfc/TestRunner.h new file mode 100644 index 0000000..b58ee42 --- /dev/null +++ b/include/cppunit/ui/mfc/TestRunner.h @@ -0,0 +1,83 @@ +#ifndef CPPUNITUI_MFC_TESTRUNNER_H +#define CPPUNITUI_MFC_TESTRUNNER_H + + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include <cppunit/Portability.h> +#include <vector> + +/* Refer to MSDN documentation to know how to write and use MFC extension DLL: + mk:@MSITStore:h:\DevStudio\MSDN\98VSa\1036\vcmfc.chm::/html/_mfcnotes_tn033.htm#_mfcnotes_how_to_write_an_mfc_extension_dll + + This can be found in the index with "mfc extension" + The basic: + Using: + - your application must use MFC DLL + - memory allocation is done using the same heap + - you must define the symbol _AFX_DLL + + Building: + - you must define the symbol _AFX_DLL and _AFX_EXT + - export class using AFX_EXT_CLASS + */ + +namespace CppUnit +{ + class Test; + class TestSuite; + +namespace MfcUi +{ + + +/*! \brief MFC test runner. + * \ingroup ExecutingTest + * + * Use this to launch the MFC TestRunner. Usually called from you CWinApp subclass: + * + * \code + * #include <cppunit/ui/mfc/TestRunner.h> + * #include <cppunit/extensions/TestFactoryRegistry.h> + * + * void + * CHostAppApp::RunUnitTests() + * { + * CppUnit::MfcUi::TestRunner runner; + * runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); + * + * runner.run(); + * } + * \endcode + * \see CppUnit::TextUi::TestRunner, CppUnit::TestFactoryRegistry. + */ +class AFX_EXT_CLASS TestRunner +{ +public: + TestRunner(); + virtual ~TestRunner(); + + void run(); + + void addTest( CppUnit::Test *test ); + + void addTests( const std::vector<CppUnit::Test *> &tests ); + +protected: + CppUnit::Test *getRootTest(); + + CppUnit::TestSuite *m_suite; + + typedef std::vector<CppUnit::Test *> Tests; + Tests m_tests; +}; + + +} // namespace MfcUi + +} // namespace CppUnit + + +#endif // CPPUNITUI_MFC_TESTRUNNER_H |
