-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
What is your suggestion?
Since conan 2.0.15 did did get a new conan.tools.cmake.CMake.ctest helper function in #15282 that no longer goes through make test, I'd like to re-ask for a couple of old feature requests that still seem (to me) like good ideas but were rejected on the (reasonable at the time) basis that the old conans.CMake.test, which used make test, didn't have a way to do them.
The first is something I asked for #12407: a [conf]tools.cmake.ctest:verbosity=quiet|progress|default|failure|verbose|extra that could be set in global.conf (or a profile), to have CI print more output than just the overall pass/fail. These would map straightforwardly to the --quiet --progress, --output-on-failure, --verbose, --extra-verbose switches ctest already has (default would just pass no flags): https://cmake.org/cmake/help/latest/manual/ctest.1.html. You could already (now) pass these with cli_args=, but it would be nice to do so globally instead of modifying recipes (since these wouldn't affect the resulting binaries if the tests do pass).
Similarly, it would be nice to have [conf]tools.cmake.ctest:junit=<path> that would add --output-junit=<path>, so that one could injest the detailed test report for display in UI like github checks or jenkins https://plugins.jenkins.io/junit/
Of course, since these are already things you can do with cli_args, so it would also be viable to just have [conf]tools.cmake.ctest:args or similar that was appended to any cli_args from the recipe. But I think things compose a bit nicer with separate conf settings.
I'd also suggest that the helper should (unconditionally) run ctest with --interactive-debug-mode 0, so you don't ever get hung in the middle of conan create or similar with a WER prompt.
Alternatively, either/both of these verbosity/output conf settings can map into fields of the https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#test-preset and the helper could pass in a preset, but that would couple the ctest helper to the CMakeToolchain generator and a version of ctest new enough to support presets. And apply the configuration even in a local development/IDE flow. So I think it makes more sense to keep this to just the recipe ctest helper and cli_args.
Have you read the CONTRIBUTING guide?
- I've read the CONTRIBUTING guide