[CMake] CTest outside of CMake

Eric Noulard eric.noulard at gmail.com
Mon Oct 17 03:06:48 EDT 2011


2011/10/17 Tim Gallagher <tim.gallagher at gatech.edu>:
> Hi,
>
> We have our project set up to run a series of test cases, but we are treating it as if we are not using CMake. I found a tutorial online on how to set it up, and we have it running just fine when we want to run all of the tests. But, I haven't figured out how to do the configure/build steps for selected tests only.
>
> For example, each test has it's own configure command and build command. If I do
>
> ctest -I 2,2
>
> then it configures and builds all the tests, but will only run the second test.
>
> The driver script contains a section like:
>
> foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
>  set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} ${LESLIE_CONFIGURE_DICT}")
>  ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
>  set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} ${LESLIE_BUILD_DICT}")
>  ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
> endforeach()
>
> and the LESLIE_AVAILABLE_TESTCASES is a list of test cases names that match the add_test() test names. Is it possible when running CTest with -I or -R (or even without -I or -R) to figure out which tests it selects so we can build LESLIE_AVAILABLE_TESTCASES from that?

I'm not sure to understand your whole testing process flow,
Is the script above part of a ctest -S script?

Filtering some tests may be done with test NAMES or LABELS
see EXCLUDE / INCLUDE or
EXCLUDE_LABEL / INCLUDE_LABEL
 arguments of ctest_test (ctest --help-command ctest_test)

However you does not seem to use ctest_test ?
How do you run your ctest command (which arguments/options are you using)?

Concerning labels
see http://www.kitware.com/blog/home/post/11 and reference therein.



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list