[CMake] add_test: specify working directory?

Dixon, Shane Shane.Dixon at atmel.com
Thu Sep 24 12:04:40 EDT 2009


I have some tests that require a TLS certificate in the same folder as the test programs.  The problem comes when I use add_test to add the test

 

ADD_TEST(ping_test ${CMAKE_CURRENT_BINARY_DIR}/testdir/bin/MyClient.exe my.server.com 4321)

SET_TESTS_PROPERTIES(ping_test PROPERTIES FAIL_REGULAR_EXPRESSION "Ping Failed")

SET_TESTS_PROPERTIES(ping_test PROPERTIES PASS_REGULAR_EXPRESSION "Ping Successful!")

 

If appears that by specifying the absolute path, it runs the MyClient.exe and the working directory isn't set to the same directory that the MyClient.exe resides.  My ping test fails horribly because it can't find the client.pem in the default working directory.  Is there any way to specify the working directory when using add_test?

 

--

Shane

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090924/2de2522a/attachment.htm>


More information about the CMake mailing list