source: trunk/contrib/cppunit-1.12.2/include/cppunit/ui/qt/QtTestRunner.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.6 KB
Line 
1// //////////////////////////////////////////////////////////////////////////
2// Header file TestRunner.h for class TestRunner
3// (c)Copyright 2000, Baptiste Lepilleur.
4// Created: 2001/09/19
5// //////////////////////////////////////////////////////////////////////////
6#ifndef CPPUNIT_QTUI_QTTESTRUNNER_H
7#define CPPUNIT_QTUI_QTTESTRUNNER_H
8
9#include <cppunit/portability/CppUnitVector.h>
10#include "Config.h"
11
12CPPUNIT_NS_BEGIN
13
14
15  class Test;
16  class TestSuite;
17
18
19/*!
20 * \brief QT test runner.
21 * \ingroup ExecutingTest
22 *
23 * Here is an example of usage:
24 * \code
25 * #include <cppunit/extensions/TestFactoryRegistry.h>
26 * #include <cppunit/ui/qt/TestRunner.h>
27 *
28 * [...]
29 *
30 * void
31 * QDepWindow::runTests()
32 * {
33 *   CppUnit::QtUi::TestRunner runner;
34 *   runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
35 *   runner.run( true );
36 * }
37 * \endcode
38 *
39 */
40class QTTESTRUNNER_API QtTestRunner
41{
42public:
43  /*! Constructs a TestRunner object.
44   */
45  QtTestRunner();
46
47  /*! Destructor.
48   */
49  virtual ~QtTestRunner();
50
51  void run( bool autoRun =false );
52
53  void addTest( Test *test );
54
55private:
56  /// Prevents the use of the copy constructor.
57  QtTestRunner( const QtTestRunner &copy );
58
59  /// Prevents the use of the copy operator.
60  void operator =( const QtTestRunner &copy );
61
62  Test *getRootTest();
63
64private:
65  typedef CppUnitVector<Test *> Tests;
66  Tests *_tests;
67
68  TestSuite *_suite;
69};
70
71
72#if CPPUNIT_HAVE_NAMESPACES
73  namespace QtUi
74  {
75    /*! Qt TestRunner (DEPRECATED).
76     * \deprecated Use CppUnit::QtTestRunner instead.
77     */
78    typedef CPPUNIT_NS::QtTestRunner TestRunner;
79  }
80#endif
81
82
83CPPUNIT_NS_END
84
85#endif  // CPPUNIT_QTUI_QTTESTRUNNER_H
Note: See TracBrowser for help on using the repository browser.