diff options
| author | Steve M. Robbins <smr@sumost.ca> | 2001-07-15 03:18:06 +0000 |
|---|---|---|
| committer | Steve M. Robbins <smr@sumost.ca> | 2001-07-15 03:18:06 +0000 |
| commit | 08b4a5c444044db09dc5c668390e9f40663210ff (patch) | |
| tree | f94c3f33864a238e3edc29c6fc92ebff748e82fa /include/cppunit/Test.h | |
| parent | 8cdfc19f2213bf1de4aee4bc5e799af49b6608d0 (diff) | |
| download | cppunit-08b4a5c444044db09dc5c668390e9f40663210ff.tar.gz | |
Added documentation.
Diffstat (limited to 'include/cppunit/Test.h')
| -rw-r--r-- | include/cppunit/Test.h | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/include/cppunit/Test.h b/include/cppunit/Test.h index 421e403..ca494ae 100644 --- a/include/cppunit/Test.h +++ b/include/cppunit/Test.h @@ -5,25 +5,54 @@ namespace CppUnit { - class TestResult; - - /** - * A Test can be run and collect its results. - * \see TestResult. - * - */ - class Test - { - public: - virtual ~Test () {}; - - virtual void run (TestResult *result) = 0; - virtual int countTestCases () const = 0; - virtual std::string toString () const = 0; - virtual std::string getName () const = 0; - - - }; +class TestResult; + +/*! \brief Base class for all test objects. + * + * All test objects should be a subclass of Test. Some test objects, + * TestCase for example, represent one individual test. Other test + * objects, such as TestSuite, are comprised of several tests. + * + * When a Test is run, the result is collected by a TestResult object. + * + * \see TestCase + * \see TestSuite + */ +class Test +{ +public: + virtual ~Test () {}; + + /*! \brief Run the test, collecting results. + */ + virtual void run (TestResult *result) = 0; + + /*! \brief Return the number of test cases invoked by run(). + * + * The base unit of testing is the class TestCase. This + * method returns the number of TestCase objects invoked by + * the run() method. + */ + virtual int countTestCases () const = 0; + + /*! \brief Returns the test name. + * + * Each test has a name. This name may be used to find the + * test in a suite or registry of tests. + */ + virtual std::string getName () const = 0; + + /*! \brief Description of the test, for diagnostic output. + * + * The test description will typically include the test name, + * but may have additional description. For example, a test + * suite named <tt>complex_add</tt> may be described as + * <tt>suite complex_add</tt>. + */ + virtual std::string toString () const = 0; + + +}; } // namespace CppUnit |
