084feeb9b1fa84a1acdc0b925c79448434a77bcf
[gssweb.git] / json_gssapi / test / test_run.cpp
1 // ? #include "stdafx.h"
2 #include <cppunit/CompilerOutputter.h>
3 #include <cppunit/extensions/TestFactoryRegistry.h>
4 #include <cppunit/ui/text/TestRunner.h>
5
6
7 int main(int argc, char* argv[])
8 {
9   // Get the top level suite from the registry
10   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
11
12   // Adds the test to the list of test to run
13   CppUnit::TextUi::TestRunner runner;
14   runner.addTest( suite );
15
16   // Change the default outputter to a compiler error format outputter
17   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
18                                                        std::cerr ) );
19   // Run the tests.
20   bool wasSucessful = runner.run();
21
22   // Return error code 1 if the one of test failed.
23   return wasSucessful ? 0 : 1;
24 }