arabica/tests/CppUnit/framework/Test.h

55 lines
900 B
C
Raw Permalink Normal View History

2005-08-04 23:23:48 +02:00
#ifndef CPPUNIT_TEST_H
#define CPPUNIT_TEST_H
#include <string>
class TestResult;
/*
* A Test can be run and collect its results.
* See TestResult.
*
*/
class Test
{
public:
virtual ~Test () = 0;
virtual void run (TestResult *result) = 0;
virtual int countTestCases () = 0;
virtual std::string name() = 0;
2005-08-04 23:23:48 +02:00
virtual std::string toString () = 0;
};
inline Test::~Test ()
{}
// Runs a test and collects its result in a TestResult instance.
2010-01-10 18:46:55 +01:00
inline void Test::run (TestResult * /* result */)
2005-08-04 23:23:48 +02:00
{}
// Counts the number of test cases that will be run by this test.
inline int Test::countTestCases ()
{ return 0; }
inline std::string Test::name()
{ return "unknown"; }
2005-08-04 23:23:48 +02:00
// Returns the name of the test instance.
inline std::string Test::toString ()
{ return ""; }
#endif