diff --git a/NFsim_v1.11/CMakeLists.txt b/NFsim_v1.11/CMakeLists.txt index 19ddda04..c6bc3ec0 100755 --- a/NFsim_v1.11/CMakeLists.txt +++ b/NFsim_v1.11/CMakeLists.txt @@ -94,16 +94,15 @@ enable_testing() add_executable(${exe_target} ${SRC_FILES}) target_link_libraries(${exe_target} vcommons vcellmessaging) -set(test1_command test1.py) -set(test2_command ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1/test2.sh) -set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}) if (WIN32) - set(test1_command py test1.py) set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}.exe) - file(TO_CMAKE_PATH ${test2_command} test2_command) + add_test(NAME ${exe_target}_test1 COMMAND py test1.py ${test_nfsim_exe} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) + add_test(NAME ${exe_target}_test2 COMMAND bash -c "test2.sh ${test_nfsim_exe}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) +else (WIN32) + set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}) + add_test(NAME ${exe_target}_test1 COMMAND ${test1_command} ${test_nfsim_exe} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) + add_test(NAME ${exe_target}_test2 COMMAND bash -c "test2.sh ${test_nfsim_exe}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) endif (WIN32) -add_test(NAME ${exe_target}_test1 COMMAND ${test1_command} ${test_nfsim_exe} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) -add_test(NAME ${exe_target}_test2 COMMAND ${test2_command} ${test_nfsim_exe} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) install(TARGETS ${exe_target} RUNTIME DESTINATION ${OPTION_EXE_DIRECTORY})