[CMake] add_test WORKING_DIRECTORY

W Eryk Wolski wewolski at gmail.com
Fri Nov 25 11:21:11 EST 2011


I am testing against reference data in the source directory.
However, I would like to perform out of source builds.


With
add_test(SpoofTest ${BinOut}/SpoofTest )
the test dont find's the data, because the data path is hard coded in the
tests and the build directory location is arbitrary.


My Idea is to use the WORKING_DIRECTORY option to execute the tests in the
Source directory.

add_test(NAME SpoofTest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${BinOut}/SpoofTest)

However, I do not understand the COMMAND parameter.

This is what I am getting when I run ctest:
Checking test dependency graph end
test 1
    Start 1: SpoofTest

1: Test command: NOT_AVAILABLE
Test not available without configuration.  (Missing "-C <config>"?)
1/1 Test #1: SpoofTest ........................***Not Run   0.00 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   2.29 sec

The following tests FAILED:
          1 - SpoofTest (Not Run)
Errors while running CTest

Can anyone please explain the COMMAND parameter to me!

Regards
Eryk







-- 
Witold Eryk Wolski

Heidmark str 5
D-28329 Bremen
tel.: 04215261837
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111125/b4184bb4/attachment.htm>


More information about the CMake mailing list