Group tests in JUnit XML by target
Hi, currently in the JUnit output there's one root <testsuite>
tag containing a flat array of many <testcase>
tags. This isn't very friendly in the consuming CI tooling if you have multiple test executables, each containing their own tests, eg. with GoogleTest:
gtest_discover_tests(testexe1)
gtest_discover_tests(testexe2)
...
The semantic grouping of these tests has been lost, making it harder to know the test's context at a glance when the CI tool says it's failed.
Would it be possible to add a flag signalling that the tests should be grouped two levels (testsuites -> testsuite -> testcase
) rather than one in the JUnit XML by some (say) TEST_SUITE
property that can be applied per add_test
invocation? gunit_discover_tests
takes a PROPERTIES
parameter, I haven't looked closely at it but perhaps that could receive the suite name.