diff --git a/NFsim_v1.11/CMakeLists.txt b/NFsim_v1.11/CMakeLists.txt index 1be89d6e..10530c5f 100755 --- a/NFsim_v1.11/CMakeLists.txt +++ b/NFsim_v1.11/CMakeLists.txt @@ -94,13 +94,14 @@ enable_testing() add_executable(${exe_target} ${SRC_FILES}) target_link_libraries(${exe_target} vcommons vcellmessaging) -# if windows then command is py test1.py, else it is test1.py -set(test_command test1.py) +set(test1_command test1.py) +set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}) if (WIN32) - set(test_command py test1.py) + set(test1_command py test1.py) + set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}.exe) endif (WIN32) -add_test(NAME ${exe_target}_test1 COMMAND ${test_command} ${CMAKE_BINARY_DIR}/bin/${exe_target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) -add_test(NAME ${exe_target}_test2 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1/test2.sh ${CMAKE_BINARY_DIR}/bin/${exe_target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) +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 ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1/test2.sh ${test_nfsim_exe} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) install(TARGETS ${exe_target} RUNTIME DESTINATION ${OPTION_EXE_DIRECTORY}) diff --git a/NFsim_v1.11/tests/test1/test1.py b/NFsim_v1.11/tests/test1/test1.py index 7e66734d..ac957092 100755 --- a/NFsim_v1.11/tests/test1/test1.py +++ b/NFsim_v1.11/tests/test1/test1.py @@ -9,7 +9,6 @@ test_dir = os.path.dirname(os.path.realpath(__file__)) # in the path replace \ with /, D:\ with /d/ test_dir = test_dir.replace("\\", "/") -test_dir = test_dir.replace("D:", "/d") # tell os.path.join to use / as the path separator os.path.sep = "/" exe = sys.argv[1]