[CMake] add_test WORKING_DIRECTORY

David Cole david.cole at kitware.com
Sat Nov 26 11:06:52 EST 2011


You are calling add_test correctly.

Now you need to call ctest like this:

  ctest -C Release
or
  ctest -C Debug

to test a particular configuration...


HTH,
David


On Fri, Nov 25, 2011 at 11:21 AM, W Eryk Wolski <wewolski at gmail.com> wrote:
> 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
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list