cmake: Ignore ctest exit code for coverage reports.
authorMathias Preiner <mathias.preiner@gmail.com>
Sun, 30 Sep 2018 05:55:33 +0000 (22:55 -0700)
committerMathias Preiner <mathias.preiner@gmail.com>
Sun, 30 Sep 2018 05:58:53 +0000 (22:58 -0700)
CMakeLists.txt

index 86007b39a441eeda6554aff1bdd277c8bb81380e..4f17db83bdcd8f830de8aae3e21b990e4ccb00da 100644 (file)
@@ -269,10 +269,15 @@ if(ENABLE_COVERAGE)
   include(CodeCoverage)
   APPEND_COVERAGE_COMPILER_FLAGS()
   add_definitions(-DCVC4_COVERAGE)
+  # Note: The ctest command returns a non-zero exit code if tests fail or run
+  # into a timeout. As a consequence, the coverage report is not generated. To
+  # prevent this we always return with exit code 0 after the ctest command has
+  # finished.
   setup_target_for_coverage_lcov(
     NAME coverage
     EXECUTABLE
-      ctest -j${CTEST_NTHREADS} -LE "example" --output-on-failure $(ARGS))
+      ctest -j${CTEST_NTHREADS} -LE "example"
+        --output-on-failure $(ARGS) || exit 0)
 endif()
 
 if(ENABLE_DEBUG_CONTEXT_MM)