middle of porting; unstable, don't checkout, added xml check output; refs #1

This commit is contained in:
Marc Wäckerlin
2011-12-11 13:47:45 +00:00
parent 2624b602af
commit 569e566b5e
15 changed files with 126 additions and 54 deletions

View File

@@ -332,7 +332,9 @@ mrw::StackTrace::BinFiles mrw::StackTrace::filename()
std::string range, perm, x1, x2, size, lib;
while (getline(is, s)) try {
range = perm = x1 = x2 = size = lib = "????";
s>>range>>perm>>x1>>x2>>size>>lib;
s>>range>>perm>>x1>>x2>>size;
if (mrw::to<int>(size)>0) {
s>>lib;
range.resize(range.find_first_not_of("0123456789abcdefABCDEF"));
void* addr(0);
range>>addr;
@@ -341,6 +343,7 @@ mrw::StackTrace::BinFiles mrw::StackTrace::filename()
// question: should only files with ending '.so' be loaded?
if (lib.size() && lib[0]!='[' && lib[lib.size()-1]!=']' && addr>0)
res<<BinFiles::value_type(lib, addr);
}
} catch (...) {} // ignore non matching lines
return res;
}

View File

@@ -85,8 +85,13 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(AutoTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -65,8 +65,13 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(ConfigFileTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -40,8 +40,13 @@ class DynamicLibraryTest: public CppUnit::TestFixture {
};
CPPUNIT_TEST_SUITE_REGISTRATION(DynamicLibraryTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -127,8 +127,13 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(ExecTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -126,8 +126,13 @@ class FunctionTraceTest: public CppUnit::TestFixture {
};
CPPUNIT_TEST_SUITE_REGISTRATION(FunctionTraceTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -237,8 +237,13 @@ namespace mrw {
CPPUNIT_TEST_SUITE_REGISTRATION(AutoFunctionTraceLog4CxxTest);
}
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -85,9 +85,13 @@ namespace mrw {
CPPUNIT_TEST_SUITE_REGISTRATION(AutoExcLog4CxxTest);
}
int main() {
log4cxx::BasicConfigurator::configure();
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -84,8 +84,13 @@ namespace mrw {
CPPUNIT_TEST_SUITE_REGISTRATION(AutoExcStderrTest);
}
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -56,8 +56,13 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(RegExpTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -155,8 +155,13 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(SmartPointerTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -76,8 +76,13 @@ namespace mrw {
CPPUNIT_TEST_SUITE_REGISTRATION(StackTraceTest);
}
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -259,8 +259,13 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(StdExtTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -42,8 +42,13 @@ class StringTest: public CppUnit::TestFixture {
};
CPPUNIT_TEST_SUITE_REGISTRATION(StringTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}

View File

@@ -67,8 +67,13 @@ public:
};
CPPUNIT_TEST_SUITE_REGISTRATION(TokenizerTest);
int main() {
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) {
std::cerr<<"***Exception: "<<e.what()<<std::endl;
return 1;
}