Dear all,

I'm encountering a problem when adding tests with add_test for CTest on OS X 10.9.4. The CTestTestfile.cmake, which should contain the tests, only has the header, but is empty otherwise (the ones in the directories above, just include the other directories correctly).
On Windows with Visual Studio all runs fine.

The code looks like this

include_directories(${Boost_INCLUDE})

add_executable(Basic-Tests MACOSX_BUNDLE Vector-Test.cpp)
target_link_libraries(Basic-Tests Basic ${Boost_LIBRARIES})
SET_PROPERTY(TARGET Basic-Tests PROPERTY FOLDER "Tests")
if(Darwin OR APPLE)
   add_test(NAME Basic-Debug-Tests
            CONFIGURATIONS Debug-iphonesimulator
COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/Basic-Tests.app/Basic-Tests" ${test_parameters} --log_sink=${test_log}/Basic-Tests.xml)
   add_test(NAME Basic-Release-Tests
            CONFIGURATIONS Release-iphonesimulator
COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/Basic-Tests.app/Basic-Tests" ${test_parameters} --log_sink=${test_log}/Basic-Tests.xml)
else()
   add_test(NAME Basic-Debug-Tests
            CONFIGURATIONS Debug
COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/Basic-Tests" ${test_parameters} --log_sink=${test_log}/Basic-Tests.xml)
   add_test(NAME Basic-Release-Tests
            CONFIGURATIONS Release
COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/Basic-Tests" ${test_parameters} --log_sink=${test_log}/Basic-Tests.xml)
endif()

CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG and CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE are set to ${CMAKE_BINARY_DIR}/Debug/bin and ${CMAKE_BINARY_DIR}/Release/bin before the call of add_test (and it is known at this location). The files and locations are correct as far as I can see (e.g. when printed as a message). test_parameters are some arguments for the test runner (I use the Boost Test Framework). enable_testing() is called in the CMakeLists.txt in the the top level source directory.

So far, I tried different configurations (Debug and Release, Release-iphoneos), checked the COMMAND argument and I also tried to use a single test with the same name as the executable target instead of two seperate ones. The tests themselves are build correctly and do run with CTest, if they are added manually (and the file is not overwritten before the tests run).

I am not sure, what the problem exactly is and what else to try to get to the root of it (or just to solve it). Thank you very much for all your help.

Best regards,
Philipp

PS: The CMake version on the Mac system is 3.0.0
--

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://public.kitware.com/mailman/listinfo/cmake

Reply via email to