We have a Bamboo server (v5.0.1) running CppUnit tests and creating an XML file with the results from 12 tests.

The CppUnit Task is being run against the XML test results file.

The build reports that there are '0 test in total', when I would expect there to be 12.

Is there a way to set up the CppUnit Task to report test results in the same way as JUnit tests are reported for Java projects? (The project appears to have all the required classes implemented according to the Atlassian docs)

Thanks!

有帮助吗?

解决方案

It turns out the test results are only correctly reported if the test name is scoped with the class name. So the original XML fails:

<?xml version="1.0" encoding='ISO-8859-1' standalone='yes' ?>
<TestRun>
  <FailedTests>
  </FailedTests>
  <SuccessfulTests>
    <Test id="1">
      <Name>AlwaysPassTest</Name>
    </Test>
  </SuccessfulTests>
  <Statistics>
    <Tests>1</Tests>
    <FailuresTotal>0</FailuresTotal>
    <Errors>0</Errors>
    <Failures>0</Failures>
  </Statistics>
</TestRun>

And this slightly updated version passes:

<?xml version="1.0" encoding='ISO-8859-1' standalone='yes' ?>
<TestRun>
  <FailedTests>
  </FailedTests>
  <SuccessfulTests>
    <Test id="1">
      <Name>SampleTest::AlwaysPassTest</Name>
    </Test>
  </SuccessfulTests>
  <Statistics>
    <Tests>1</Tests>
    <FailuresTotal>0</FailuresTotal>
    <Errors>0</Errors>
    <Failures>0</Failures>
  </Statistics>
</TestRun>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top