From: Joel Rosdahl Date: Mon, 22 Jun 2020 20:18:23 +0000 (+0200) Subject: Tweak CMakeLists.txt X-Git-Tag: v4.0~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e74c2abf75ea0ba9d28287cad650618053feb73;p=thirdparty%2Fccache.git Tweak CMakeLists.txt --- 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()