From 4e1f76fae58a7e0db111ec68e616e6ea3222f726 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周日, 13 10月 2019 16:17:06 +0800 Subject: [PATCH] fix windows tests --- test/library/CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 46 insertions(+), 7 deletions(-) diff --git a/test/library/CMakeLists.txt b/test/library/CMakeLists.txt index c8c638c..78ad9ad 100644 --- a/test/library/CMakeLists.txt +++ b/test/library/CMakeLists.txt @@ -1,15 +1,54 @@ -link_directories ( ${Boost_LIBRARY_DIRS} ) - add_executable( - license_reader_test + test_license_reader LicenseReader_test.cpp ) target_link_libraries( - license_reader_test - license++_static + test_license_reader + licensecc_static ${Boost_LIBRARIES} ) -SET_TARGET_PROPERTIES(license_reader_test PROPERTIES LINK_SEARCH_START_STATIC ON) -ADD_TEST(license_reader_test ${EXECUTABLE_OUTPUT_PATH}/LicenseReader_test) +IF( ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") AND CMAKE_CROSSCOMPILING) +#binfmt_misc doesn't work in my system :( + ADD_TEST(NAME test_license_reader COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/test_license_reader) +ELSE() + ADD_TEST(NAME test_license_reader COMMAND test_license_reader) +ENDIF() + +IF(WIN32) +#test windows +ELSE(WIN32) + add_executable( + test_os_linux + Os_Linux_test.cpp + ) + + target_link_libraries( + test_os_linux + os + ${Boost_LIBRARIES} + ) + + ADD_TEST(NAME test_os_linux COMMAND test_os_linux) +ENDIF(WIN32) + + +### LicenseLocator tests +add_executable( + test_license_locator + LicenseLocator_test.cpp +) + +target_link_libraries( + test_license_locator + locators + ${Boost_LIBRARIES} +) + +IF( ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") AND CMAKE_CROSSCOMPILING) +#binfmt_misc doesn't work in my system :( + ADD_TEST(NAME test_license_locator COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/test_license_locator) +ELSE() + ADD_TEST(NAME test_license_locator COMMAND test_license_locator) +ENDIF() \ No newline at end of file -- Gitblit v1.9.1