@@ -10,13 +10,27 @@ foreach(test_name IN LISTS test-files${suffix}) # <- DO NOT EXPAND LIST
1010 list (APPEND test_sources "${test_name} .cpp" )
1111endforeach ()
1212
13- set (test_target "test-ext-logging${suffix} " )
14- add_executable ("${test_target} " gtest.cpp ${test_sources} )
15- target_include_directories ("${test_target} " SYSTEM PRIVATE ${gtest_SOURCE_DIR} /include )
16- target_link_libraries ("${test_target} " ext ::basics ext ::logging gtest_main gtest Threads::Threads)
17- target_compile_options ("${test_target} " PRIVATE ${ext_stone-warnings})
18- target_compile_definitions ("${test_target} " PUBLIC EXT_CHECKED=1 EXT_IN_TEST=1)
19- # -- repeated calls should append which does not happen for me (cmake 3.16 on linux)
20- #target_compile_definitions("${test_target}" PUBLIC EXT_IN_TEST=1
21- add_test (NAME "${test_target} _run" COMMAND $<TARGET_FILE:${test_target} >)
22- set_target_properties (${test_target} PROPERTIES FOLDER tests/${test_target} )
13+ foreach (suffix IN ITEMS "" )
14+ #build one executable
15+ set (test_sources)
16+ foreach (test_name IN LISTS test -files ${suffix} ) # <- DO NOT EXPAND LIST
17+ list (APPEND test_sources "${test_name} .cpp" )
18+ endforeach ()
19+
20+ set (test_target "test-ext-logging${suffix} " )
21+ add_executable ("${test_target} " gtest.cpp ${test_sources} )
22+ target_include_directories ("${test_target} " SYSTEM PRIVATE ${gtest_SOURCE_DIR} /include )
23+ target_link_libraries ("${test_target} "
24+ ext ::basics${suffix}
25+ ext ::logging${suffix}
26+ gtest_main gtest
27+ Threads::Threads
28+ std::filesystem
29+ )
30+ target_compile_options ("${test_target} " PRIVATE ${ext_stone-warnings})
31+ target_compile_definitions ("${test_target} " PUBLIC EXT_CHECKED=1 EXT_IN_TEST=1)
32+ # -- repeated calls should append which does not happen for me (cmake 3.16 on linux)
33+ #target_compile_definitions("${test_target}" PUBLIC EXT_IN_TEST=1
34+ add_test (NAME "${test_target} _run" COMMAND $<TARGET_FILE:${test_target} >)
35+ set_target_properties (${test_target} PROPERTIES FOLDER tests/${test_target} )
36+ endforeach ()
0 commit comments