CppUnit project page FAQ CppUnit home page

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CppUnit::Test Class Reference
[Browsing collected test result]

Base class for all test objects. More...

#include <Test.h>

Inheritance diagram for CppUnit::Test:

CppUnit::TestCase CppUnit::TestDecorator CppUnit::TestSuite CppUnit::Orthodox CppUnit::TestCaller CppUnit::RepeatedTest CppUnit::TestSetUp List of all members.

Public Methods

virtual ~Test ()
virtual void run (TestResult *result)=0
 Run the test, collecting results. More...

virtual int countTestCases () const=0
 Return the number of test cases invoked by run(). More...

virtual std::string getName () const=0
 Returns the test name. More...

virtual std::string toString () const=0
 Description of the test, for diagnostic output. More...


Detailed Description

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 also:
TestCase , TestSuite


Constructor & Destructor Documentation

virtual CppUnit::Test::~Test   [inline, virtual]
 


Member Function Documentation

virtual int CppUnit::Test::countTestCases   const [pure virtual]
 

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.

Implemented in CppUnit::RepeatedTest.

virtual std::string CppUnit::Test::getName   const [pure virtual]
 

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.

Implemented in CppUnit::TestDecorator.

virtual void CppUnit::Test::run TestResult   result [pure virtual]
 

Run the test, collecting results.

Implemented in CppUnit::RepeatedTest.

virtual std::string CppUnit::Test::toString   const [pure virtual]
 

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 complex_add may be described as suite complex_add.

Implemented in CppUnit::RepeatedTest.


The documentation for this class was generated from the following file:
SourceForge Logo hosts this site. Send comments to:
CppUnit Developers