diff options
Diffstat (limited to 'include/cppunit/ui/qt')
| -rw-r--r-- | include/cppunit/ui/qt/Makefile.am | 1 | ||||
| -rw-r--r-- | include/cppunit/ui/qt/QtTestRunner.h | 85 | ||||
| -rw-r--r-- | include/cppunit/ui/qt/TestRunner.h | 67 |
3 files changed, 87 insertions, 66 deletions
diff --git a/include/cppunit/ui/qt/Makefile.am b/include/cppunit/ui/qt/Makefile.am index eb213f7..7d4fb46 100644 --- a/include/cppunit/ui/qt/Makefile.am +++ b/include/cppunit/ui/qt/Makefile.am @@ -2,4 +2,5 @@ libcppunitincludedir = $(includedir)/cppunit/ui/qt libcppunitinclude_HEADERS = \ TestRunner.h \ + QtTestRunner.h \ Config.h diff --git a/include/cppunit/ui/qt/QtTestRunner.h b/include/cppunit/ui/qt/QtTestRunner.h new file mode 100644 index 0000000..4b6ab4e --- /dev/null +++ b/include/cppunit/ui/qt/QtTestRunner.h @@ -0,0 +1,85 @@ +// ////////////////////////////////////////////////////////////////////////// +// Header file TestRunner.h for class TestRunner +// (c)Copyright 2000, Baptiste Lepilleur. +// Created: 2001/09/19 +// ////////////////////////////////////////////////////////////////////////// +#ifndef CPPUNIT_QTUI_QTTESTRUNNER_H +#define CPPUNIT_QTUI_QTTESTRUNNER_H + +#include <cppunit/portability/CppUnitVector.h> +#include "Config.h" + +CPPUNIT_NS_BEGIN + + + class Test; + class TestSuite; + + +/*! + * \brief QT test runner. + * \ingroup ExecutingTest + * + * Here is an example of usage: + * \code + * #include <cppunit/extensions/TestFactoryRegistry.h> + * #include <cppunit/ui/qt/TestRunner.h> + * + * [...] + * + * void + * QDepWindow::runTests() + * { + * CppUnit::QtUi::TestRunner runner; + * runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); + * runner.run( true ); + * } + * \endcode + * + */ +class QTTESTRUNNER_API QtTestRunner +{ +public: + /*! Constructs a TestRunner object. + */ + QtTestRunner(); + + /*! Destructor. + */ + virtual ~QtTestRunner(); + + void run( bool autoRun =false ); + + void addTest( Test *test ); + +private: + /// Prevents the use of the copy constructor. + QtTestRunner( const QtTestRunner © ); + + /// Prevents the use of the copy operator. + void operator =( const QtTestRunner © ); + + Test *getRootTest(); + +private: + typedef CppUnitVector<Test *> Tests; + Tests *_tests; + + TestSuite *_suite; +}; + + +#if CPPUNIT_HAVE_NAMESPACES + namespace QtUi + { + /*! Qt TestRunner (DEPRECATED). + * \deprecated Use CppUnit::QtTestRunner instead. + */ + typedef CPPUNIT_NS::QtTestRunner TestRunner; + } +#endif + + +CPPUNIT_NS_END + +#endif // CPPUNIT_QTUI_QTTESTRUNNER_H diff --git a/include/cppunit/ui/qt/TestRunner.h b/include/cppunit/ui/qt/TestRunner.h index d58772b..9c53e4b 100644 --- a/include/cppunit/ui/qt/TestRunner.h +++ b/include/cppunit/ui/qt/TestRunner.h @@ -6,71 +6,6 @@ #ifndef CPPUNIT_QTUI_TESTRUNNER_H #define CPPUNIT_QTUI_TESTRUNNER_H -#include <vector> -#include "Config.h" - -CPPUNIT_NS_BEGIN - - - class Test; - class TestSuite; - - namespace QtUi - { - -/*! - * \brief QT test runner. - * \ingroup ExecutingTest - * - * Here is an example of usage: - * \code - * #include <cppunit/extensions/TestFactoryRegistry.h> - * #include <cppunit/ui/qt/TestRunner.h> - * - * [...] - * - * void - * QDepWindow::runTests() - * { - * CppUnit::QtUi::TestRunner runner; - * runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() ); - * runner.run( true ); - * } - * \endcode - * - */ -class QTTESTRUNNER_API TestRunner -{ -public: - /*! Constructs a TestRunner object. - */ - TestRunner(); - - /*! Destructor. - */ - virtual ~TestRunner(); - - void run( bool autoRun =false ); - - void addTest( Test *test ); - -private: - /// Prevents the use of the copy constructor. - TestRunner( const TestRunner © ); - - /// Prevents the use of the copy operator. - void operator =( const TestRunner © ); - - Test *getRootTest(); - -private: - typedef std::vector<Test *> Tests; - Tests *_tests; - - TestSuite *_suite; -}; - - -CPPUNIT_NS_END +#include <cppunit/ui/qt/QtTestRunner.h> #endif // CPPUNIT_QTUI_TESTRUNNER_H |
