]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Do not report skipped tests as failures on CMake <3.9 (#609)
authorAlexander Lanin <alex@lanin.de>
Mon, 22 Jun 2020 20:14:23 +0000 (22:14 +0200)
committerGitHub <noreply@github.com>
Mon, 22 Jun 2020 20:14:23 +0000 (22:14 +0200)
dockerfiles/alpine-3.4/Dockerfile
dockerfiles/alpine/Dockerfile [deleted file]
test-all-systems.sh
test/CMakeLists.txt

index 8c5d0aba442726f8b5621d54d0ca05a37f4f5f81..b178a08b4f546200150a8c8791a9a63096853b98 100644 (file)
@@ -1,8 +1,5 @@
 # Released 2016, this is the first release to contain cmake >= 3.4.3
 
-# Note: While alpine 3.4 runs fine, cmake 3.8.1 reports skipped tests as failures while cmake 3.9.5 reports them as skipped.
-# So alpine 3.7 is the first version to report exit code 0. Maybe install new cmake manually here?
-
 FROM alpine:3.4
 
 RUN apk add --no-cache \
diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile
deleted file mode 100644 (file)
index 66f8a44..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-FROM alpine:latest
-
-RUN apk add --no-cache \
-                gcc libc-dev \
-                make \
-                bash \
-                build-essential \
-                cmake \
-                asciidoc \
-                autoconf \
-                zstd-dev \
-        ##
index 9798518e1467489fd5325b6fc72cdbf4af04d2c1..0683ec94f60e80507f7b93839682e7dcfaa9411c 100755 (executable)
@@ -11,7 +11,6 @@
 
 # Next steps:
 # * run compilation, tests and/or docker instances in parallel to improve runtime.
-# * improve detection of failures so this script can be executed as a whole (see Note in alpine 3.4 Dockerfile).
 
 echo "Warning: Docker support is rather experimental\n"
 
index 17c62e9a8a6cee527ea066106335142dd53e5ba1..8ddc2172c5d02ff82d2d572e64484145544bd4be 100644 (file)
@@ -4,12 +4,23 @@ function(addtest name)
     COMMAND ${CMAKE_SOURCE_DIR}/test/run ${name}
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
   )
-  set(environment CCACHE=${CMAKE_BINARY_DIR}/ccache EXIT_IF_SKIPPED=true)
-  set_tests_properties(
-    "producttest.${name}"
-    PROPERTIES
-    ENVIRONMENT "${environment}"
-    SKIP_RETURN_CODE 125)
+  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
+      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)
+  endif()
+
 endfunction()
 
 addtest(base)