Menu

displaying current tests suite name

Anonymous
2003-08-19
2003-09-11
  • Anonymous

    Anonymous - 2003-08-19

    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 ?

     
    • Anthon Pang

      Anthon Pang - 2003-09-11

      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 ...
      };

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.