EDIT: This issue has been fixed by google in gtest 1.4.0; see the original bug report for more information.
I've recently switched to gtest for my C++ testing framework, and one great feature of it which I am presently unable to use is the ability to generate JUnit-style XML test reports, which could then be read in by our hudson build server.
The XML output generated by the gtest test suite all looks legit:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="370" failures="0" disabled="0" errors="0" time="45.61" name="AllTests">
<testsuite name="application" tests="7" failures="0" disabled="0" errors="0" time="8.953">
<testcase name="zero_tasks_on_bootup" status="run" time="0" classname="application" />
...etc.
</testsuite>
</testsuite>
I've also tried adding a JUnitReport task to my ant build script, which works fine, and generates XML like so:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="370" failures="0" disabled="0" errors="0" time="45.61" name="AllTests">
<testsuite name="application" tests="7" failures="0" disabled="0" errors="0" time="8.953">
<testcase name="zero_tasks_on_bootup" status="run" time="0" classname="application" />
...etc.
</testsuite>
</testsuite>
The problem is, whenever I tell ant to publish the JUnit test results, and then point it to either the raw test result XML, or the compiled result generated in the ant JUnitReport task, hudson always complains about finding no test results there.
I'm not a java guy, so I can't tell what's going on here, and I can't find an example of how the JUnit XML ought to look like. Can someone help to point me in the right direction?
See Question&Answers more detail:os