CTest: Support split test suites
GitLab-CI supports running a job in "parallel" with itself. In such a setup, each split job has environment variables named CI_NODE_INDEX
and CI_NODE_TOTAL
. It would be nice to have CTest split a test suite with such arguments via ctest_test
and the command line for such CI features. Something like:
ctest_test(
TEST_PARTITION "$ENV{CI_NODE_INDEX}/$ENV{CI_NODE_TOTAL}"
…)
ctest --partition $CI_NODE_INDEX/$CI_NODE_TOTAL …
We would also need support for merging multiple Test.xml
files in the end. The resulting Test.xml
files in such a setup should be named according to the $CI_NODE_INDEX
to avoid collisions when the different bits are brought together:
ctest_merge(PARTS Test) # Finds `Test-*.xml` files and writes out a final `Test.xml` file.
ctest_submit(PARTS Test) # Submits the merged `Test.xml` file.