From: Aleš Křenek Date: Thu, 3 Feb 2005 12:12:52 +0000 (+0000) Subject: run test_parse and dump xml X-Git-Tag: gridsite-core_R_1_1_5~56 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=35ef0871ab6cd769a365d0907a136938c922bd46;p=jra1mw.git run test_parse and dump xml --- diff --git a/org.glite.lb.common/Makefile b/org.glite.lb.common/Makefile index 1b14264..3ee7200 100644 --- a/org.glite.lb.common/Makefile +++ b/org.glite.lb.common/Makefile @@ -134,7 +134,7 @@ mkreports: check.parse: test_parse echo "XXX: nyk -> fixed build interrupt :)" - # ./test_parse + ./test_parse ${REPORTS}/parse.xml test_parse: parse.cpp ${CXX} -c ${CFLAGS} ${TEST_INC} $< diff --git a/org.glite.lb.common/test/il_test.cpp b/org.glite.lb.common/test/il_test.cpp index 37ccd79..6f89861 100644 --- a/org.glite.lb.common/test/il_test.cpp +++ b/org.glite.lb.common/test/il_test.cpp @@ -1,5 +1,4 @@ #include -#include #include diff --git a/org.glite.lb.common/test/parse.cpp.T b/org.glite.lb.common/test/parse.cpp.T index face531..e417041 100644 --- a/org.glite.lb.common/test/parse.cpp.T +++ b/org.glite.lb.common/test/parse.cpp.T @@ -1,9 +1,14 @@ -#include +#include + +#include #include #include -#include -#include +#include +#include +#include +#include +#include #include @@ -140,11 +145,25 @@ void EventParseTest::$l(){ CPPUNIT_TEST_SUITE_REGISTRATION( EventParseTest ); -int main (int ac,const char *av[]) +int main (int argc,const char *argv[]) { CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); - CppUnit::TextUi::TestRunner runner; - + + assert(argc == 2); + std::ofstream xml(argv[1]); + + CppUnit::TestResult controller; + CppUnit::TestResultCollector result; + controller.addListener( &result ); + + CppUnit::TestRunner runner; runner.addTest(suite); - return runner.run() ? 0 : 1; + runner.run(controller); + + CppUnit::XmlOutputter xout( &result, xml ); + CppUnit::CompilerOutputter tout( &result, std::cout); + xout.write(); + tout.write(); + + return result.wasSuccessful() ? 0 : 1 ; }