diff --git a/tests/core/CMakeLists.txt b/tests/core/CMakeLists.txt index 2105d37a..a70c1fbf 100644 --- a/tests/core/CMakeLists.txt +++ b/tests/core/CMakeLists.txt @@ -10,6 +10,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) diff --git a/tests/tier1/CMakeLists.txt b/tests/tier1/CMakeLists.txt index b899c6e3..39c2c72a 100644 --- a/tests/tier1/CMakeLists.txt +++ b/tests/tier1/CMakeLists.txt @@ -10,6 +10,24 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) @@ -19,3 +37,4 @@ endfunction() foreach(TEST_NAME IN LISTS TEST_NAMES) add_test_executable(${TEST_NAME} ${CURRENT_TIER}) endforeach() + diff --git a/tests/tier2/CMakeLists.txt b/tests/tier2/CMakeLists.txt index b7f7981c..90159697 100644 --- a/tests/tier2/CMakeLists.txt +++ b/tests/tier2/CMakeLists.txt @@ -10,6 +10,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) diff --git a/tests/tier3/CMakeLists.txt b/tests/tier3/CMakeLists.txt index c6756eba..b85c0a56 100644 --- a/tests/tier3/CMakeLists.txt +++ b/tests/tier3/CMakeLists.txt @@ -10,6 +10,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) diff --git a/tests/tier4/CMakeLists.txt b/tests/tier4/CMakeLists.txt index ecae926c..c4f55605 100644 --- a/tests/tier4/CMakeLists.txt +++ b/tests/tier4/CMakeLists.txt @@ -10,6 +10,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) diff --git a/tests/tier5/CMakeLists.txt b/tests/tier5/CMakeLists.txt index 414683ff..a30a7519 100644 --- a/tests/tier5/CMakeLists.txt +++ b/tests/tier5/CMakeLists.txt @@ -10,6 +10,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) diff --git a/tests/tier6/CMakeLists.txt b/tests/tier6/CMakeLists.txt index ae14fdd5..71da9eca 100644 --- a/tests/tier6/CMakeLists.txt +++ b/tests/tier6/CMakeLists.txt @@ -11,6 +11,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) diff --git a/tests/tier7/CMakeLists.txt b/tests/tier7/CMakeLists.txt index ffed1134..63d79f64 100644 --- a/tests/tier7/CMakeLists.txt +++ b/tests/tier7/CMakeLists.txt @@ -10,6 +10,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE) diff --git a/tests/tier8/CMakeLists.txt b/tests/tier8/CMakeLists.txt index ffed1134..63d79f64 100644 --- a/tests/tier8/CMakeLists.txt +++ b/tests/tier8/CMakeLists.txt @@ -10,6 +10,22 @@ function(add_test_executable test_name tier_name) add_executable(${test_name} ${test_name}.cpp) add_dependencies(${test_name} CLIc) target_link_libraries(${test_name} PRIVATE CLIc::CLIc gtest gtest_main) + + if(WIN32) + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + add_custom_command(TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" + "$") + endif() + set_target_properties(${test_name} PROPERTIES FOLDER "Tests") add_test(NAME ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${test_name}) set_tests_properties(${test_name} PROPERTIES LABELS ${tier_name} WILL_FAIL FALSE)