diff options
Diffstat (limited to 'test/test.cc')
-rw-r--r-- | test/test.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/test.cc b/test/test.cc index 171a578..7830e2c 100644 --- a/test/test.cc +++ b/test/test.cc @@ -1,7 +1,11 @@ -#include <cppunit/CompilerOutputter.h> +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +//#include <cppunit/CompilerOutputter.h> +#include <cppunit/XmlOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/ui/text/TestRunner.h> +#include <fstream> + int main(int argc, char* argv[]) { // Get the top level suite from the registry @@ -11,12 +15,15 @@ int main(int argc, char* argv[]) CppUnit::TextUi::TestRunner runner; runner.addTest( suite ); - // Change the default outputter to a compiler error format outputter - runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(), - std::cerr ) ); + std::ofstream myfile; + myfile.open("result_"OUTPUT".xml"); + runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), myfile)); + // Run the tests. bool wasSucessful = runner.run(); + myfile.close(); + // Return error code 1 if the one of test failed. return wasSucessful ? 0 : 1; } |