Blame examples/money/MoneyApp.cpp
|
Packit |
8c9aa0 |
#include "StdAfx.h"
|
|
Packit |
8c9aa0 |
#include <cppunit/CompilerOutputter.h>
|
|
Packit |
8c9aa0 |
#include <cppunit/extensions/TestFactoryRegistry.h>
|
|
Packit |
8c9aa0 |
#include <cppunit/ui/text/TestRunner.h>
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
int main()
|
|
Packit |
8c9aa0 |
{
|
|
Packit |
8c9aa0 |
// Get the top level suite from the registry
|
|
Packit |
8c9aa0 |
CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
// Adds the test to the list of test to run
|
|
Packit |
8c9aa0 |
CPPUNIT_NS::TextUi::TestRunner runner;
|
|
Packit |
8c9aa0 |
runner.addTest( suite );
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
// Change the default outputter to a compiler error format outputter
|
|
Packit |
8c9aa0 |
runner.setOutputter( new CPPUNIT_NS::CompilerOutputter( &runner.result(),
|
|
Packit |
8c9aa0 |
CPPUNIT_NS::stdCOut() ) );
|
|
Packit |
8c9aa0 |
// Run the test.
|
|
Packit |
8c9aa0 |
bool wasSucessful = runner.run();
|
|
Packit |
8c9aa0 |
|
|
Packit |
8c9aa0 |
// Return error code 1 if the one of test failed.
|
|
Packit |
8c9aa0 |
return wasSucessful ? 0 : 1;
|
|
Packit |
8c9aa0 |
}
|
|
Packit |
8c9aa0 |
|