From 2e74c2abf75ea0ba9d28287cad650618053feb73 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 22 Jun 2020 22:18:23 +0200 Subject: [PATCH] Tweak CMakeLists.txt --- test/CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8ddc2172c..889ddf661 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,21 +4,22 @@ function(addtest name) COMMAND ${CMAKE_SOURCE_DIR}/test/run ${name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) - set_tests_properties("producttest.${name}" PROPERTIES + set_tests_properties( + "producttest.${name}" + PROPERTIES ENVIRONMENT "CCACHE=${CMAKE_BINARY_DIR}/ccache;EXIT_IF_SKIPPED=true") if(${CMAKE_VERSION} VERSION_LESS "3.9") - # Older cmake versions treat skipped tests as errors. - # Therefore resort to parsing output for those cases. - # Exit code is not considered. - # Skipped tests will appear as "Passed". - set_tests_properties("producttest.${name}" PROPERTIES + # Older CMake versions treat skipped tests as errors. Therefore, resort to + # parsing output for those cases (exit code is not considered). Skipped + # tests will appear as "Passed". + set_tests_properties( + "producttest.${name}" + PROPERTIES PASS_REGULAR_EXPRESSION "PASSED|Passed|Skipped" FAIL_REGULAR_EXPRESSION "[Ww]arning|[Ff]ail|[Er]rror") else() - set_tests_properties( - "producttest.${name}" PROPERTIES - SKIP_RETURN_CODE 125) + set_tests_properties("producttest.${name}" PROPERTIES SKIP_RETURN_CODE 125) endif() endfunction() -- 2.47.3