Nithin Sade
05/11/2021, 3:18 AMtheopolis
Stefano Bonicatti
05/11/2021, 2:33 PMadd_test
directives behind the check of the tests being enabled or not.
In that case then it won’t attempt to run anything because there’s no test enabled.
It’s only a tad more verbose in CMake code to do.theopolis
Nithin Sade
05/11/2021, 5:10 PMStefano Bonicatti
05/12/2021, 3:20 PMtest
target is a pseudo target, meaning that you can pass it as such in the cmake --target
command or any `ninja`/`make` command, but it’s not seen as such in CMake code.
Also on Windows with msbuild that is run_tests
.
One way I’ve seen it done is to create a custom target/custom command that launches cmake --build . --target test
and then you can have any command before or after that.. the problem with that is that on Windows with msbuild, 90% of the time you cannot interrupt the tests with a Ctrl+C… and that’s rather annoying.