From 5a8a12d7a2c69610cd7a9a00ed1b3579b750a914 Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周六, 16 11月 2019 21:39:10 +0800
Subject: [PATCH] issue #42 #38 \n review build system, \n issue #38 added clang format

---
 test/functional/CMakeLists.txt |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/test/functional/CMakeLists.txt b/test/functional/CMakeLists.txt
index 4e3773d..0dd0a42 100644
--- a/test/functional/CMakeLists.txt
+++ b/test/functional/CMakeLists.txt
@@ -1,14 +1,58 @@
+ADD_LIBRARY(license_generator_snippet STATIC
+ 	generate-license.cpp
+)
+
+target_link_libraries(
+	license_generator_snippet
+ 	license_generator_lib
+)
 
 add_executable(
- standard_license_test
+ test_standard_license
  standard-license_test.cpp
 )
 
 target_link_libraries(
- standard_license_test
- license++_static
- license_generator_lib
+ test_standard_license
+ licensecc_static
+ license_generator_snippet
+ ${Boost_LIBRARIES}
 )
 
-SET_TARGET_PROPERTIES(standard_license_test PROPERTIES LINK_SEARCH_START_STATIC ON)
-ADD_TEST(standard_license_test ${EXECUTABLE_OUTPUT_PATH}/standard_license_test)
+add_executable(
+ test_date
+ date_test.cpp
+)
+
+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}
+)
+
+#set CROSSCOMPILING_EMULATOR
+IF( ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") AND CMAKE_CROSSCOMPILING)
+#binfmt_misc doesn't work in my system :(
+	ADD_TEST(NAME test_standard_license COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/test_standard_license 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 test_standard_license COMMAND test_standard_license 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