output cppunit to xml for bitten
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <cppunit/XmlOutputter.h>
|
||||
#include <fstream>
|
||||
|
||||
class A: public xml::Serialize {
|
||||
public:
|
||||
@@ -163,8 +165,10 @@ class ContainerSerializationTest: public CppUnit::TestFixture {
|
||||
};
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(ContainerSerializationTest);
|
||||
|
||||
int main() try {
|
||||
int main(int argc, char** argv) try {
|
||||
std::ofstream ofs((*argv+std::string(".xml")).c_str());
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), ofs));
|
||||
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
|
||||
return runner.run() ? 0 : 1;
|
||||
} catch (std::exception& e) {
|
||||
|
@@ -10,6 +10,8 @@
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <cppunit/XmlOutputter.h>
|
||||
#include <fstream>
|
||||
|
||||
class A: public xml::Serialize {
|
||||
public:
|
||||
@@ -344,8 +346,10 @@ class SerializationTest: public CppUnit::TestFixture {
|
||||
};
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SerializationTest);
|
||||
|
||||
int main() try {
|
||||
int main(int argc, char** argv) try {
|
||||
std::ofstream ofs((*argv+std::string(".xml")).c_str());
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), ofs));
|
||||
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
|
||||
return runner.run() ? 0 : 1;
|
||||
} catch (std::exception& e) {
|
||||
|
@@ -10,6 +10,8 @@
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <cppunit/XmlOutputter.h>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
class NodeTest: public CppUnit::TestFixture {
|
||||
@@ -443,8 +445,10 @@ class FunTest: public CppUnit::TestFixture {
|
||||
};
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(FunTest);
|
||||
|
||||
int main() try {
|
||||
int main(int argc, char** argv) try {
|
||||
std::ofstream ofs((*argv+std::string(".xml")).c_str());
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), ofs));
|
||||
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
|
||||
return runner.run() ? 0 : 1;
|
||||
} catch (std::exception& e) {
|
||||
|
Reference in New Issue
Block a user