source: trunk/contrib/cppunit-1.12.2/include/cppunit/ui/mfc/MfcTestRunner.h @ 876

Last change on this file since 876 was 876, checked in by sam, 9 years ago

contrib: add a precompiled Win32 version of CppUnit and update build system
accordingly.

File size: 1.7 KB
Line 
1#ifndef CPPUNITUI_MFC_MFCTESTRUNNER_H
2#define CPPUNITUI_MFC_MFCTESTRUNNER_H
3
4#if _MSC_VER >= 1000
5#pragma once
6#endif // _MSC_VER >= 1000
7
8#include <cppunit/Portability.h>
9#include <cppunit/portability/CppUnitVector.h>
10
11/* Refer to MSDN documentation to know how to write and use MFC extension DLL:
12   mk:@MSITStore:h:\DevStudio\MSDN\98VSa\1036\vcmfc.chm::/html/_mfcnotes_tn033.htm#_mfcnotes_how_to_write_an_mfc_extension_dll
13   
14   This can be found in the index with "mfc extension"
15   The basic:
16   Using:
17   - your application must use MFC DLL
18   - memory allocation is done using the same heap
19   - you must define the symbol _AFX_DLL
20
21   Building:
22   - you must define the symbol _AFX_DLL and _AFX_EXT
23   - export class using AFX_EXT_CLASS
24 */
25
26CPPUNIT_NS_BEGIN
27
28  class Test;
29  class TestSuite;
30
31
32/*! \brief MFC test runner.
33 * \ingroup ExecutingTest
34 *
35 * Use this to launch the MFC TestRunner. Usually called from you CWinApp subclass:
36 *
37 * \code
38 * #include <cppunit/ui/mfc/MfcTestRunner.h>
39 * #include <cppunit/extensions/TestFactoryRegistry.h>
40 *
41 * void
42 * CHostAppApp::RunUnitTests()
43 * {
44 *   CppUnit::MfcTestRunner runner;
45 *   runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
46 *
47 *   runner.run();   
48 * }
49 * \endcode
50 * \see CppUnit::TextTestRunner, CppUnit::TestFactoryRegistry.
51 */
52class AFX_EXT_CLASS MfcTestRunner
53{
54public:
55  MfcTestRunner();
56  virtual ~MfcTestRunner();
57
58  void run();
59
60  void addTest( Test *test );
61
62  void addTests( const CppUnitVector<Test *> &tests );
63
64protected:
65  Test *getRootTest();
66
67  TestSuite *m_suite;
68
69  typedef CppUnitVector<Test *> Tests;
70  Tests m_tests;
71};
72
73
74CPPUNIT_NS_END
75
76#endif // CPPUNITUI_MFC_MFCTESTRUNNER_H
Note: See TracBrowser for help on using the repository browser.