1234567891011121314151617181920212223242526272829303132333435 |
- #ifdef NICE_USELIB_CPPUNIT
- #include <cppunit/CompilerOutputter.h>
- #include <cppunit/extensions/TestFactoryRegistry.h>
- #include <cppunit/ui/text/TestRunner.h>
- #endif
- int main(int argc, char* argv[]) {
- (void)argc;
- (void)argv;
- #ifdef NICE_USELIB_CPPUNIT
-
- CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
-
- CppUnit::TextUi::TestRunner runner;
- runner.addTest( suite );
-
- runner.setOutputter(
- new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
-
-
- bool wasSucessful = runner.run();
-
- return wasSucessful ? 0 : 1;
- #else
- #error "Install cppunit (http://cppunit.sourceforge.net/cppunit-wiki)"
- return 1;
- #endif
- }
|