ATLAS Offline Software
Functions
CppUnit_testdriver.cxx File Reference
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TextTestRunner.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/TextOutputter.h>
#include <cppunit/XmlOutputter.h>
#include <iostream>
Include dependency graph for CppUnit_testdriver.cxx:

Go to the source code of this file.

Functions

int main (int, char **)
 Main class for all the CppUnit test classes
More...
 

Function Documentation

◆ main()

int main ( int  ,
char **   
)

Main class for all the CppUnit test classes

This will be the driver class of all your CppUnit test classes.

  • All registered CppUnit test classes will be run.
  • You can also modify the output (text, compiler, XML).
  • This class will also integrate CppUnit test with Oval

Get the top level suite from the registry

Adds the test to the list of test to run

Run the tests.

Definition at line 21 of file CppUnit_testdriver.cxx.

22  {
24  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
25 
27  CppUnit::TextTestRunner runner;
28  runner.addTest( suite );
29 
30  // Change the default outputter to a compiler error format outputter
31  // uncomment the following line if you need a compiler outputter.
32  //runner.setOutputter(new CppUnit::CompilerOutputter( &runner.result(),
33  // std::cerr ) );
34 
35  // Change the default outputter to a xml error format outputter
36  // uncomment the following line if you need a xml outputter.
37  //runner.setOutputter( new CppUnit::XmlOutputter( &runner.result(),
38  // std::cerr ) );
39 
41  // bool wasSuccessful = runner.run_spi();
42  // If you want to avoid the CppUnit typical output change the line above
43  // by the following one:
44  bool wasSuccessful = runner.run("",false,true,false);
45 
46  // Return error code 1 if the one of test failed.
47  if (!wasSuccessful) return 1;
48 
49  // Uncomment the next line if you want to integrate CppUnit with Oval
50  // std::cout <<"[OVAL] Cppunit-result ="<<!wasSuccessful<<"\n" ;
51  return 0;
52  }
beamspotman.runner
runner
Definition: beamspotman.py:1192
python.TestCases.suite
def suite()
Definition: DataQualityConfigurations/python/TestCases.py:73