# 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 \
# 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"
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)