diff --git a/NFsim_v1.11/CMakeLists.txt b/NFsim_v1.11/CMakeLists.txt index 79764284..9c98ae24 100755 --- a/NFsim_v1.11/CMakeLists.txt +++ b/NFsim_v1.11/CMakeLists.txt @@ -95,17 +95,19 @@ add_executable(${exe_target} ${SRC_FILES}) target_link_libraries(${exe_target} vcommons vcellmessaging) if (MINGW) - set(test_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}.exe) - add_test(NAME ${exe_target}_test1 COMMAND py ${test_src_dir}/test1.py ${test_nfsim_exe} WORKING_DIRECTORY ${test_src_dir}) - add_test(NAME ${exe_target}_test2 COMMAND bash -c "${test_src_dir}/test2.sh ${test_nfsim_exe}" WORKING_DIRECTORY ${test_src_dir}) + set(python_cmd py) else (MINGW) - set(test_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}) - add_test(NAME ${exe_target}_test1 COMMAND python3 ${test_src_dir}/test1.py ${test_nfsim_exe} WORKING_DIRECTORY ${test_src_dir}) -# add_test(NAME ${exe_target}_test2 COMMAND ${test_src_dir}/test2.sh ${test_nfsim_exe} WORKING_DIRECTORY ${test_src_dir}) - add_test(NAME ${exe_target}_test2 COMMAND bash -c "${test_src_dir}/test2.sh ${test_nfsim_exe}" WORKING_DIRECTORY ${test_src_dir}) + set(python_cmd python3) endif (MINGW) +set(test_dir ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1) + +# smoke test as a python script +add_test(NAME ${exe_target}_test1 COMMAND ${python_cmd} ${test_dir}/test1.py ${test_nfsim_exe} WORKING_DIRECTORY ${test_dir}) + +# smoke test as a bash script +add_test(NAME ${exe_target}_test2 COMMAND bash -c "${test_dir}/test2.sh ${test_nfsim_exe}" WORKING_DIRECTORY ${test_dir}) install(TARGETS ${exe_target} RUNTIME DESTINATION ${OPTION_EXE_DIRECTORY})