summaryrefslogtreecommitdiff
path: root/examples/cppunittest/CppUnitTestMain.cpp
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-04-13 17:51:20 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-04-13 17:51:20 +0000
commit70d62c5c20105c982df7379e2e61148fc959ff35 (patch)
tree5c8a2bf11b5bba69f999d93e5519d766988caf88 /examples/cppunittest/CppUnitTestMain.cpp
parent342c67d11745f45c60deea59163c035ca5780619 (diff)
downloadcppunit-70d62c5c20105c982df7379e2e61148fc959ff35.tar.gz
Include/cppunit/XmlOutputter.
include/cppunit/XmlOutputter.h: * src/cppunit/XmlOutputter.cpp: Made XML output more human readable. Idented element. * examples/cppunittest/XmlUniformiser.h: * examples/cppunittest/XmlUniformiser.cpp: * examples/cppunittest/XmlUniformiserTest.cpp: modified to ignore trailing space at the end of element content.
Diffstat (limited to 'examples/cppunittest/CppUnitTestMain.cpp')
-rw-r--r--examples/cppunittest/CppUnitTestMain.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/cppunittest/CppUnitTestMain.cpp b/examples/cppunittest/CppUnitTestMain.cpp
index fad2868..04da95d 100644
--- a/examples/cppunittest/CppUnitTestMain.cpp
+++ b/examples/cppunittest/CppUnitTestMain.cpp
@@ -3,8 +3,10 @@
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/TextTestProgressListener.h>
+#include <cppunit/XmlOutputter.h>
#include "CppUnitTestSuite.h"
#include <stdexcept>
+#include <fstream>
int
@@ -37,7 +39,13 @@ main( int argc, char* argv[] )
// Print test in a compiler compatible format.
CppUnit::CompilerOutputter outputter( &result, std::cerr );
- outputter.write();
+ outputter.write();
+
+ std::ofstream file( "tests.xml" );
+ CppUnit::XmlOutputter xml( &result, file );
+ xml.setStyleSheet( "report.xsl" );
+ xml.write();
+ file.close();
}
catch ( std::invalid_argument &e ) // Test path not resolved
{