Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
513 Brean 1
#include <cppunit/CompilerOutputter.h>
2
#include <cppunit/extensions/TestFactoryRegistry.h>
3
#include <cppunit/TestResult.h>
4
#include <cppunit/TestResultCollector.h>
5
#include <cppunit/TestRunner.h>
6
#include <cppunit/BriefTestProgressListener.h>
7
 
8
int main( int argc, char* argv[] )
9
{
10
    // Create the event manager and test controller
11
    CPPUNIT_NS::TestResult controller;
12
 
13
    // Add a listener that colllects test result
14
    CPPUNIT_NS::TestResultCollector result;
15
    controller.addListener( &result );
16
 
17
    // Add a listener to show progress of single tests
18
    CPPUNIT_NS :: BriefTestProgressListener progress;
19
    controller.addListener (&progress);
20
 
21
    // Add the top suite to the test runner
22
    CPPUNIT_NS::TestRunner runner;
23
    runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
24
    runner.run( controller );
25
 
26
    // Print test in a compiler compatible format.
27
    CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
28
    outputter.write();
29
 
30
    return result.wasSuccessful() ? 0 : 1;
31
}
32