I would like to be able in a similar manner as I can run cmake
like
cmake -H<src-directory> -B<bld-directory>
cmake --build <bld_directory>
to run ctest
like
ctest --build <bld_directory>
Obviously running ctest
from the will work,
but it would be nice if I can just tell ctest
where to look for its configuration file and where the test executables are located.
From the documentation it is not very clear (or I might not have looked in the right place) if this is possible at all or not.
It would great if somebody could shed some light on if this is possible or not ? Many thanks, Jiri
I couldn't find the way to do it through
ctest
options, but it is doable using the rulemake test
which is linked to ctest.In the
Makefile
generated by cmake in your build folder you can find the rule:make
provides the option that you want with-C /path/to/build_directory/
, and you can add anyctest
options withARGS='your ctest options here'
For example, from any directory in your system you can write:
make test -C /path/to/build_folder ARGS='-R SpecificTestIWantToRun -VV'
or
cmake --build <bld_directory> --target test -- ARGS="<ctest_args>"