From f3a3d463532a3ae3078baa2420c6372edf343f47 Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Thu, 21 Oct 2021 21:07:32 +0200 Subject: [PATCH 1/4] Remove build type from configuration step. --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 1c34030..3f631c3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -29,7 +29,7 @@ before_build: - if defined BINDIR (set "PATH=%BINDIR%;%PATH:C:\Program Files\Git\usr\bin;=%") - md build_dir - cd build_dir - - cmake -Wno-dev -DEXTLOG_TESTS=ON -DEXTLOG_EXAMPLES=ON --config "%CONFIGURATION%" -G "%GENERATOR%" .. + - cmake -Wno-dev -DEXTLOG_TESTS=ON -DEXTLOG_EXAMPLES=ON -G "%GENERATOR%" .. build_script: - cmake --build . --config "%CONFIGURATION%" From 104dcd7608b33e68517ce217c5cf21a05a24c48a Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Sun, 2 Feb 2020 18:57:46 +0100 Subject: [PATCH 2/4] Try to make appveryor more verbose during tests. --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 3f631c3..18c5eb4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -35,4 +35,4 @@ build_script: - cmake --build . --config "%CONFIGURATION%" test_script: - - ctest -C "%CONFIGURATION%" --output-on-failure + - ctest -C "%CONFIGURATION%" --rerun-failed --output-on-failure -VV From c745bde2b01af1c81250004dbc741412ffc577b1 Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Thu, 21 Oct 2021 21:35:31 +0200 Subject: [PATCH 3/4] Make test CMakeLists.txt similar to the code in `basics` --- tests/CMakeLists.txt | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8db40cc..b337598 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,13 +10,26 @@ foreach(test_name IN LISTS test-files${suffix}) # <- DO NOT EXPAND LIST list(APPEND test_sources "${test_name}.cpp") endforeach() -set(test_target "test-ext-logging${suffix}") -add_executable("${test_target}" gtest.cpp ${test_sources}) -target_include_directories("${test_target}" SYSTEM PRIVATE ${gtest_SOURCE_DIR}/include) -target_link_libraries("${test_target}" ext::basics ext::logging gtest_main gtest Threads::Threads) -target_compile_options("${test_target}" PRIVATE ${ext_stone-warnings}) -target_compile_definitions("${test_target}" PUBLIC EXT_CHECKED=1 EXT_IN_TEST=1) -# -- repeated calls should append which does not happen for me (cmake 3.16 on linux) -#target_compile_definitions("${test_target}" PUBLIC EXT_IN_TEST=1 -add_test(NAME "${test_target}_run" COMMAND $) -set_target_properties (${test_target} PROPERTIES FOLDER tests/${test_target}) +foreach(suffix IN ITEMS "") + #build one executable + set(test_sources) + foreach(test_name IN LISTS test-files${suffix}) # <- DO NOT EXPAND LIST + list(APPEND test_sources "${test_name}.cpp") + endforeach() + + set(test_target "test-ext-logging${suffix}") + add_executable("${test_target}" gtest.cpp ${test_sources}) + target_include_directories("${test_target}" SYSTEM PRIVATE ${gtest_SOURCE_DIR}/include) + target_link_libraries("${test_target}" + ext::basics${suffix} + ext::logging${suffix} + gtest_main gtest + Threads::Threads + ) + target_compile_options("${test_target}" PRIVATE ${ext_stone-warnings}) + target_compile_definitions("${test_target}" PUBLIC EXT_CHECKED=1 EXT_IN_TEST=1) + # -- repeated calls should append which does not happen for me (cmake 3.16 on linux) + #target_compile_definitions("${test_target}" PUBLIC EXT_IN_TEST=1 + add_test(NAME "${test_target}_run" COMMAND $) + set_target_properties (${test_target} PROPERTIES FOLDER tests/${test_target}) +endforeach() From 04ad8bd2e1ef72062ffc456e276ff2e6a001ff41 Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Thu, 21 Oct 2021 21:51:28 +0200 Subject: [PATCH 4/4] wip --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 18c5eb4..41e4be0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -35,4 +35,5 @@ build_script: - cmake --build . --config "%CONFIGURATION%" test_script: + - C:\projects\logging\build_dir\tests\Release\test-ext-logging.exe - ctest -C "%CONFIGURATION%" --rerun-failed --output-on-failure -VV