diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index 85546c1510..d2345ceaa7 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -36,7 +36,11 @@ if(Python_EXECUTABLE) COMMENT "Check completeness of force style tests") endif() -set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests) +if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + string(REPLACE "/" "\\\\" TEST_INPUT_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/tests") +else() + set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests) +endif() add_library(style_tests STATIC yaml_writer.cpp error_stats.cpp test_config_reader.cpp test_main.cpp) if(YAML_FOUND) target_compile_definitions(style_tests PRIVATE TEST_INPUT_FOLDER=${TEST_INPUT_FOLDER}) diff --git a/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml b/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml index 48075274fe..0f8ca18eec 100644 --- a/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml +++ b/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml @@ -10,8 +10,7 @@ pre_commands: ! | variable units index real variable newton_pair delete variable newton_pair index on - if $(is_os(^Windows)) then "variable copycmd string copy" else "variable copycmd string cp" - shell ${copycmd} ${input_dir}/table_CG_CG_CG.txt . + if $(is_os(^Windows)) then "shell copy ${input_dir}\table_CG_CG_CG.txt ." else "shell cp ${input_dir}/table_CG_CG_CG.txt ." post_commands: ! "" input_file: in.metal pair_style: hybrid/overlay table linear 1200 sw/angle/table diff --git a/unittest/force-styles/tests/atomic-pair-threebody_table.yaml b/unittest/force-styles/tests/atomic-pair-threebody_table.yaml index 5b0c0b5aab..cf3566490e 100644 --- a/unittest/force-styles/tests/atomic-pair-threebody_table.yaml +++ b/unittest/force-styles/tests/atomic-pair-threebody_table.yaml @@ -10,9 +10,8 @@ pre_commands: ! | variable units index real variable newton_pair delete variable newton_pair index on - if $(is_os(^Windows)) then "variable copycmd string copy" else "variable copycmd string cp" - shell ${copycmd} ${input_dir}/1-1-1.table . - shell ${copycmd} ${input_dir}/1-1-2.table . + if $(is_os(^Windows)) then "shell copy ${input_dir}\1-1-1.table ." else "shell cp ${input_dir}/1-1-1.table ." + if $(is_os(^Windows)) then "shell copy ${input_dir}\1-1-2.table ." else "shell cp ${input_dir}/1-1-2.table ." post_commands: ! "" input_file: in.metal pair_style: hybrid/overlay table linear 1200 threebody/table