summaryrefslogtreecommitdiff
path: root/include/cppunit/ui/qt
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-04-10 14:22:30 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-04-10 14:22:30 +0000
commit6c2d743aed2eb4c0a960edaadc7366faa3b24c5c (patch)
treeb41f82e9b41c48e9dcb1cc59833dff26e88817d7 /include/cppunit/ui/qt
parent0e44bc8d5fa467b9d1c835b2e40b17f538e4bbe3 (diff)
downloadcppunit-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/qt')
-rw-r--r--include/cppunit/ui/qt/Config.h21
-rw-r--r--include/cppunit/ui/qt/TestRunner.h81
2 files changed, 102 insertions, 0 deletions
diff --git a/include/cppunit/ui/qt/Config.h b/include/cppunit/ui/qt/Config.h
new file mode 100644
index 0000000..73eac3c
--- /dev/null
+++ b/include/cppunit/ui/qt/Config.h
@@ -0,0 +1,21 @@
+#ifndef CPPUNIT_QTUI_CONFIG_H
+#define CPPUNIT_QTUI_CONFIG_H
+
+/*! Macro to export symbol to DLL with VC++.
+ *
+ * - QTTESTRUNNER_DLL_BUILD must be defined when building the DLL.
+ * - QTTESTRUNNER_DLL must be defined if linking against the DLL.
+ * - If none of the above are defined then you are building or linking against
+ * the static library.
+ */
+
+#if defined( QTTESTRUNNER_DLL_BUILD )
+# define QTTESTRUNNER_API __declspec(dllexport)
+#elif defined ( QTTESTRUNNER_DLL )
+# define QTTESTRUNNER_API __declspec(dllimport)
+#else
+# define QTTESTRUNNER_API
+#endif
+
+
+#endif // CPPUNIT_QTUI_CONFIG_H \ No newline at end of file
diff --git a/include/cppunit/ui/qt/TestRunner.h b/include/cppunit/ui/qt/TestRunner.h
new file mode 100644
index 0000000..d293b08
--- /dev/null
+++ b/include/cppunit/ui/qt/TestRunner.h
@@ -0,0 +1,81 @@
+// //////////////////////////////////////////////////////////////////////////
+// Header file TestRunner.h for class TestRunner
+// (c)Copyright 2000, Baptiste Lepilleur.
+// Created: 2001/09/19
+// //////////////////////////////////////////////////////////////////////////
+#ifndef CPPUNIT_QTUI_TESTRUNNER_H
+#define CPPUNIT_QTUI_TESTRUNNER_H
+
+#include <vector>
+#include "Config.h"
+
+namespace CppUnit
+{
+ 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( CppUnit::Test *test );
+
+private:
+ /// Prevents the use of the copy constructor.
+ TestRunner( const TestRunner &copy );
+
+ /// Prevents the use of the copy operator.
+ void operator =( const TestRunner &copy );
+
+ Test *getRootTest();
+
+private:
+ typedef std::vector<Test *> Tests;
+ Tests *_tests;
+
+ TestSuite *_suite;
+};
+
+
+
+// Inlines methods for TestRunner:
+// -------------------------------
+
+
+ } // namespace QtUi
+} // namespace CppUnit
+
+#endif // CPPUNIT_QTUI_TESTRUNNER_H