-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_runner.cpp
More file actions
34 lines (26 loc) · 828 Bytes
/
test_runner.cpp
File metadata and controls
34 lines (26 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Execute this program to run the test suite.
*
* Usually there's no need to change anything in here.
*/
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
using namespace CppUnit;
int main(void) {
TestResult controller;
TestResultCollector result;
controller.addListener(&result);
BriefTestProgressListener progress;
controller.addListener(&progress);
TestRunner runner;
runner.addTest( TestFactoryRegistry::getRegistry().makeTest() );
runner.run(controller);
CompilerOutputter outputter(&result, std::cerr);
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}
// EOF