Description
The XML options of Qt Test library is a major feature for integration with external tools.
It can be used for produce test log that will be then be parse by IDE ( Eclipse Unit Tests runner) or continuous integration ( Jenkins XUnit)
As is with the actual MultiTest, those integration need an extra scripting phase for :
- Create a single consistent XML output.
- Save to different files each cases result
Note that other options provides by Qt Test Lib ( lightxml
and xunitxml
) should be concerned too.
Consistent single file
The purpose will be to have a single consistent XML file that cover all test suite.
Each case have a section.
I've experiment that it's possible to produce a similar file in few steps from the output of current MultiTest runner with the -xml
option
- Create a top level
<TestCase name=testSuite>
XML element - For all cases remove XML header and output them are children of the test suite element
- (Optional for Eclipse) :
BenchmarkResult
need a rename ofWalltimeMilliseconds
towalltime
- Append after the cases results a list of all messages
- Close the top level
</TestCase>
File splitting
The purpose is to be able to save into one directory a XML file for each of the test case.
The XML header is an easy tag to detect the start of a new case.
Name of outputs files can just be incremented from one case to the next one ( result_1.xml
, result_2.xml
, etc.)