From cbf436621e2343d4c769258d0d74daebe3c5ac74 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周日, 13 10月 2019 19:44:07 +0800 Subject: [PATCH] fix test windows --- test/functional/CMakeLists.txt | 48 +++++++++++++++++++++++++++++++++++++----------- 1 files changed, 37 insertions(+), 11 deletions(-) diff --git a/test/functional/CMakeLists.txt b/test/functional/CMakeLists.txt index a343dc6..3d122ea 100644 --- a/test/functional/CMakeLists.txt +++ b/test/functional/CMakeLists.txt @@ -1,6 +1,7 @@ ADD_LIBRARY(license_generator_snippet STATIC generate-license.cpp ) + target_link_libraries( license_generator_snippet license_generator_lib @@ -10,23 +11,48 @@ standard_license_test standard-license_test.cpp ) + target_link_libraries( standard_license_test - license++_static + licensecc_static license_generator_snippet + ${Boost_LIBRARIES} ) -SET_TARGET_PROPERTIES(standard_license_test PROPERTIES LINK_SEARCH_START_STATIC ON) add_executable( - date_test + test_date date_test.cpp ) -target_link_libraries( - date_test - license++_static - license_generator_snippet -) -SET_TARGET_PROPERTIES(date_test PROPERTIES LINK_SEARCH_START_STATIC ON) -ADD_TEST(standard_license_test ${EXECUTABLE_OUTPUT_PATH}/standard_license_test) -ADD_TEST(date_test ${EXECUTABLE_OUTPUT_PATH}/date_test) \ No newline at end of file +target_link_libraries( + test_date + licensecc_static + license_generator_snippet + ${Boost_LIBRARIES} +) + +add_executable( + test_volid + volid_test.cpp +) + +target_link_libraries( + test_volid + licensecc_static + license_generator_snippet + ${Boost_LIBRARIES} +) + + +IF( ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") AND CMAKE_CROSSCOMPILING) +#binfmt_misc doesn't work in my system :( + ADD_TEST(NAME standard_license_test COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/standard_license_test WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + ADD_TEST(NAME test_date COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/test_date WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + ADD_TEST(NAME test_volid COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/test_volid WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +ELSE() + ADD_TEST(NAME standard_license_test COMMAND standard_license_test WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + ADD_TEST(NAME test_date COMMAND test_date WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + ADD_TEST(NAME test_volid COMMAND test_volid WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +ENDIF() + + -- Gitblit v1.9.1