My Project
 All Classes Files Functions
RunApp.cpp
Go to the documentation of this file.
1 
21 #include <cppunit/CompilerOutputter.h>
22 #include <cppunit/extensions/TestFactoryRegistry.h>
23 #include <cppunit/ui/text/TestRunner.h>
24 
31 int main(int argc, char* argv[])
32 {
33  // Get the top level suite from the registry
34  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
35 
36  // Adds the test to the list of test to run
37  CppUnit::TextUi::TestRunner runner;
38  runner.addTest( suite );
39 
40  // Change the default outputter to a compiler error format outputter
41  runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
42  std::cerr ) );
43  // Run the tests.
44  bool wasSucessful = runner.run();
45 
46  getchar();
47 
48  // Return error code 1 if the one of test failed.
49  return wasSucessful ? 0 : 1;
50 }
int main(int argc, char *argv[])
Definition: RunApp.cpp:31