On 07/31/2013 03:08 PM, Orion Poplawski wrote:
Is there a way to pass arguments to ctest via the "make check" target?


Okay, here's what's up. This recipe: http://www.cmake.org/Wiki/CMakeEmulateMakeCheck :

add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})

is not terribly useful in that it appears impossible to pass options to ctest from the "make check" command line. In Fedora packaging we want to generally add -V and sometimes exclude certain tests with -E 'test1|test2|...'.

I tried doing:

cmake -DCMAKE_CTEST_COMMAND="/usr/bin/ctest -V -E 'test'"

but then I end up with:

CMakeFiles/check.dir/build.make:
CMakeFiles/check:
        "/usr/bin/ctest -V -E 'test'"

which fails because of the quoting:

make[3]: Entering directory `/builddir/build/BUILD/eigen-eigen-ffa86ffb5570/noarch-redhat-linux-gnu'
"/usr/bin/ctest -V -E 'gmres_2|minres_1|bdcsvd_2'"
/bin/sh: /usr/bin/ctest -V -E 'gmres_2|minres_1|bdcsvd_2': No such file or directory
make[3]: *** [CMakeFiles/check] Error 127


At least with the old style:

add_custom_target(check COMMAND ${CMAKE_BUILD_TOOL} test)

You had access to the ARGS variable passed to ctest in the test target. Although that apparently breaks parallel make options (http://www.cmake.org/pipermail/cmake/2009-March/027941.html)


Thoughts?

--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       [email protected]
Boulder, CO 80301                   http://www.nwra.com
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to