13
0
livetrax/libs/canvas/test/testrunner.cpp

28 lines
807 B
C++
Raw Normal View History

#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/BriefTestProgressListener.h>
int
main()
{
CppUnit::TestResult testresult;
CppUnit::TestResultCollector collectedresults;
testresult.addListener (&collectedresults);
CppUnit::BriefTestProgressListener progress;
testresult.addListener (&progress);
CppUnit::TestRunner testrunner;
testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
testrunner.run (testresult);
CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
compileroutputter.write ();
return collectedresults.wasSuccessful () ? 0 : 1;
}