summaryrefslogtreecommitdiff
path: root/include/cppunit/TestSuite.h
diff options
context:
space:
mode:
authorBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-14 21:37:31 +0000
committerBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-14 21:37:31 +0000
commitfb5695f7ca74f6557bdff1ceff009628ac3adc4a (patch)
tree8e6c05a5db8ef1c3037a10f579c31f0eb38a087e /include/cppunit/TestSuite.h
parentf5f2b1d2761b1d81c042d51619182c7951fd23aa (diff)
downloadcppunit-fb5695f7ca74f6557bdff1ceff009628ac3adc4a.tar.gz
Moved public header files from cppunit dir to include/cppunit, to separate them from internal header files like estring.h.
Diffstat (limited to 'include/cppunit/TestSuite.h')
-rw-r--r--include/cppunit/TestSuite.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/cppunit/TestSuite.h b/include/cppunit/TestSuite.h
new file mode 100644
index 0000000..ffa21a8
--- /dev/null
+++ b/include/cppunit/TestSuite.h
@@ -0,0 +1,58 @@
+#ifndef CPPUNIT_TESTSUITE_H
+#define CPPUNIT_TESTSUITE_H
+
+#include <vector>
+#include <string>
+
+#ifndef CPPUNIT_TEST_H
+#include "Test.h"
+#endif
+
+namespace CppUnit {
+
+ class TestResult;
+
+ /**
+ * A TestSuite is a Composite of Tests.
+ * It runs a collection of test cases. Here is an example.
+ * \code
+ * CppUnit::TestSuite *suite= new CppUnit::TestSuite();
+ * suite->addTest(new CppUnit::TestCaller<MathTest> (
+ * "testAdd", testAdd));
+ * suite->addTest(new CppUnit::TestCaller<MathTest> (
+ * "testDivideByZero", testDivideByZero));
+ * \endcode
+ * Note that TestSuites assume lifetime
+ * control for any tests added to them.
+ *
+ * TestSuites do not register themselves in the TestRegistry.
+ * \see Test
+ * \see TestCaller
+ */
+
+
+ class TestSuite : public Test
+ {
+ public:
+ TestSuite (std::string name = "");
+ ~TestSuite ();
+
+ void run (TestResult *result);
+ int countTestCases () const;
+ void addTest (Test *test);
+ std::string getName () const;
+ std::string toString () const;
+
+ virtual void deleteContents ();
+
+ private:
+ TestSuite (const TestSuite& other);
+ TestSuite& operator= (const TestSuite& other);
+
+ private:
+ std::vector<Test *> m_tests;
+ const std::string m_name;
+ };
+} // namespace CppUnit
+
+#endif // CPPUNIT_TESTSUITE_H