From: Lukáš Lalinský Date: Sat, 14 Jan 2012 09:16:54 +0000 (+0100) Subject: Make it possible to generate an XML report X-Git-Tag: v1.8beta~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d904281c6baaabaa79946c19e1ebcd205243cc60;p=taglib Make it possible to generate an XML report --- diff --git a/tests/main.cpp b/tests/main.cpp index 348751e4..ab89dc3e 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,3 +1,6 @@ +#include +#include +#include #include #include #include @@ -5,6 +8,7 @@ #include #include #include +#include int main(int argc, char* argv[]) { @@ -34,6 +38,13 @@ int main(int argc, char* argv[]) // Print test in a compiler compatible format. CppUnit::CompilerOutputter outputter(&result, std::cerr); outputter.write(); + + char *xml = ::getenv("CPPUNIT_XML"); + if(xml && !::strcmp(xml, "1")) { + std::ofstream xmlfileout("cpptestresults.xml"); + CppUnit::XmlOutputter xmlout(&result, xmlfileout); + xmlout.write(); + } } catch(std::invalid_argument &e){ std::cerr << std::endl