32 #include <cppunit/ui/text/TestRunner.h> 33 #include <cppunit/XmlOutputter.h> 34 #include <cppunit/TextOutputter.h> 35 #include <cppunit/CompilerOutputter.h> 36 #include <cppunit/extensions/TestFactoryRegistry.h> 45 int main(
int argc,
char* argv[])
58 std::string arg(argv[i]);
60 if (i + 1 < argc) next_arg = argv[i + 1];
63 if (arg ==
"--text") { format =
TEXT_OUT;
break; }
76 ofs.open(fname.c_str());
78 if ( arg ==
"--compiler" ) { format =
COMPILER_OUT;
break; }
79 if ( arg ==
"--cerr" ) { target = 1;
break; }
82 if (next_arg ==
"") xsl =
"default.xsl";
85 if ( arg ==
"--namespace" )
89 std::cerr <<
"no namespace specified" << std::endl;
99 CppUnit::TextUi::TestRunner runner;
101 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
103 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry(ns).makeTest());
104 CppUnit::Outputter* outputter = 0;
105 std::ostream* stream = target ? &std::cerr : &std::cout;
109 outputter =
new CppUnit::TextOutputter(&runner.result(),*stream);
112 std::cout <<
"XML_OUT" << std::endl;
113 outputter =
new CppUnit::XmlOutputter(&runner.result(),
115 static_cast<CppUnit::XmlOutputter*
>(outputter)->setStyleSheet(xsl);
118 outputter =
new CppUnit::CompilerOutputter(&runner.result(),*stream);
121 runner.setOutputter(outputter);
int main(int argc, char *argv[])