From 8a2012e4b27a4b4ad64418613c5798b33f3b7368 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Thu, 3 Feb 2005 15:04:02 +0000 Subject: [PATCH] all current tests output XML --- org.glite.lb.common/Makefile | 4 +-- org.glite.lb.common/test/il_test.cpp | 46 +--------------------------------- org.glite.lb.common/test/parse.cpp.T | 32 ++--------------------- org.glite.lb.common/test/test_gss.cpp | 18 ++++++------- org.glite.lb.common/test/test_main.cpp | 32 +++++++++++++++++++++++ 5 files changed, 45 insertions(+), 87 deletions(-) create mode 100644 org.glite.lb.common/test/test_main.cpp diff --git a/org.glite.lb.common/Makefile b/org.glite.lb.common/Makefile index 3ee7200..bdb2abf 100644 --- a/org.glite.lb.common/Makefile +++ b/org.glite.lb.common/Makefile @@ -33,6 +33,7 @@ GLOBUSINC:= -I${globus_prefix}/include/${nothrflavour} GLOBUSTHRINC:= -I${globus_prefix}/include/${thrflavour} CFLAGS:=${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \ + -I${top_srcdir}/test \ -I${stagedir}/include \ -I${glite_location}/include \ -I${expat_prefix}/include \ @@ -133,7 +134,6 @@ mkreports: -mkdir ${REPORTS} check.parse: test_parse - echo "XXX: nyk -> fixed build interrupt :)" ./test_parse ${REPORTS}/parse.xml test_parse: parse.cpp @@ -142,7 +142,7 @@ test_parse: parse.cpp check.gss: test_gss # ./test_gss - echo test_gss not run automatically util we have got some credentials + @echo test_gss not run automatically util we have got some credentials check.il: il_test ./il_test ${REPORTS}/il.xml diff --git a/org.glite.lb.common/test/il_test.cpp b/org.glite.lb.common/test/il_test.cpp index 6f89861..59d51c7 100644 --- a/org.glite.lb.common/test/il_test.cpp +++ b/org.glite.lb.common/test/il_test.cpp @@ -1,45 +1 @@ -#include - -#include - -#include -#include -// #include - -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); - -#if 0 - CppUnit::TextTestRunner runner; - - runner.addTest(suite); - runner.setOutputter(CppUnit::CompilerOutputter::defaultOutputter(&runner.result(), std::cerr)); - - return runner.run() ? 0 : 1; -#endif - - assert(argc == 2); - - std::ofstream xml(argv[1]); - - CppUnit::TestResult controller; - CppUnit::TestResultCollector result; - controller.addListener( &result ); - - CppUnit::TestRunner runner; - runner.addTest(suite); - runner.run(controller); - - CppUnit::XmlOutputter xout( &result, xml ); - CppUnit::CompilerOutputter tout( &result, std::cout); - xout.write(); - tout.write(); - - return result.wasSuccessful() ? 0 : 1 ; -} +#include "test_main.cpp" diff --git a/org.glite.lb.common/test/parse.cpp.T b/org.glite.lb.common/test/parse.cpp.T index e417041..896c227 100644 --- a/org.glite.lb.common/test/parse.cpp.T +++ b/org.glite.lb.common/test/parse.cpp.T @@ -1,14 +1,7 @@ -#include - -#include +#include #include -#include -#include -#include #include -#include -#include #include @@ -145,25 +138,4 @@ void EventParseTest::$l(){ CPPUNIT_TEST_SUITE_REGISTRATION( EventParseTest ); -int main (int argc,const char *argv[]) -{ - CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); - - assert(argc == 2); - std::ofstream xml(argv[1]); - - CppUnit::TestResult controller; - CppUnit::TestResultCollector result; - controller.addListener( &result ); - - CppUnit::TestRunner runner; - runner.addTest(suite); - runner.run(controller); - - CppUnit::XmlOutputter xout( &result, xml ); - CppUnit::CompilerOutputter tout( &result, std::cout); - xout.write(); - tout.write(); - - return result.wasSuccessful() ? 0 : 1 ; -} +#include "test_main.cpp" diff --git a/org.glite.lb.common/test/test_gss.cpp b/org.glite.lb.common/test/test_gss.cpp index d6df484..89a0c86 100644 --- a/org.glite.lb.common/test/test_gss.cpp +++ b/org.glite.lb.common/test/test_gss.cpp @@ -1,13 +1,17 @@ #include +#include + +#include #include #include #include #include -#include -#include +#include +#include +#include #include "lb_gss.h" @@ -139,11 +143,5 @@ void GSSTest::errorTest() CPPUNIT_TEST_SUITE_REGISTRATION( GSSTest ); -int main (int ac,const char *av[]) -{ - CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); - CppUnit::TextUi::TestRunner runner; - - runner.addTest(suite); - return runner.run() ? 0 : 1; -} + +#include "test_main.cpp" diff --git a/org.glite.lb.common/test/test_main.cpp b/org.glite.lb.common/test/test_main.cpp new file mode 100644 index 0000000..b2f6fdd --- /dev/null +++ b/org.glite.lb.common/test/test_main.cpp @@ -0,0 +1,32 @@ +#include +#include + +#include +#include +#include +#include +#include +#include + +int main (int argc,const char *argv[]) +{ + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + + assert(argc == 2); + std::ofstream xml(argv[1]); + + CppUnit::TestResult controller; + CppUnit::TestResultCollector result; + controller.addListener( &result ); + + CppUnit::TestRunner runner; + runner.addTest(suite); + runner.run(controller); + + CppUnit::XmlOutputter xout( &result, xml ); + CppUnit::CompilerOutputter tout( &result, std::cout); + xout.write(); + tout.write(); + + return result.wasSuccessful() ? 0 : 1 ; +} -- 1.8.2.3