i'd like to display (in text mode) the current tests suite name during the testing process (each time, a new tests suite is reached, its name is displayed) and other statistics.
Does anyone have an idea how to proceed ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Take a look at TestListener.h -- it defines a number of callback methods called at the start of a suite, end of a run, failure, etc. The easiest thing to do is subclass TestListener and then register your object to receive notifications (via callbacks).
Example:
class MyListener : public CPPUNIT_NS::TestListener
{
// Register your object ...
CPPUNIT_NS::TestResult *result;
result = new CPPUNIT_NS::TestResult();
result->addListener( this );
// ... and define your callbacks
void startTest( CPPUNIT_NS::Test *test )
{
++nofTests;
}
Hello,
i'd like to display (in text mode) the current tests suite name during the testing process (each time, a new tests suite is reached, its name is displayed) and other statistics.
Does anyone have an idea how to proceed ?
Take a look at TestListener.h -- it defines a number of callback methods called at the start of a suite, end of a run, failure, etc. The easiest thing to do is subclass TestListener and then register your object to receive notifications (via callbacks).
Example:
class MyListener : public CPPUNIT_NS::TestListener
{
// Register your object ...
CPPUNIT_NS::TestResult *result;
result = new CPPUNIT_NS::TestResult();
result->addListener( this );
// ... and define your callbacks
void startTest( CPPUNIT_NS::Test *test )
{
++nofTests;
}
void addFailure(const CPPUNIT_NS::TestFailure &failure)
{
++nofFailures;
}
// ... etc ...
};