]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add codecov support
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 24 Apr 2018 14:58:50 +0000 (16:58 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 24 Apr 2018 22:19:46 +0000 (00:19 +0200)
tests/run_testsuite.cmake

index 6d628af11b476b2f4eca4921a5fee3bcbaa7d282..51deed64e8343358ae835c980735b7c46ace9fb9 100644 (file)
@@ -412,13 +412,20 @@ COVERAGE=TRUE.
       )
   ENDIF()
 
-  FIND_PROGRAM(GCOV_COMMAND NAMES gcov)
-  IF(GCOV_COMMAND MATCHES "-NOTFOUND")
-    MESSAGE(FATAL_ERROR "
-Coverage enabled but could not find the gcov executable. Please install
-gcov, which is part of the GNU Compiler Collection.
-"
-      )
+  IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    FIND_PROGRAM(GCOV_COMMAND NAMES llvm-cov)
+    SET(GCOV_COMMAND "${GCOV_COMMAND} gcov")
+    IF(GCOV_COMMAND MATCHES "-NOTFOUND")
+      MESSAGE(FATAL_ERROR "Coverage enabled but could not find the
+                           llvm-cov executable, which is part of LLVM.")
+    ENDIF()
+  ELSE()
+    FIND_PROGRAM(GCOV_COMMAND NAMES gcov)
+    IF(GCOV_COMMAND MATCHES "-NOTFOUND")
+      MESSAGE(FATAL_ERROR "Coverage enabled but could not find the
+                           gcov executable, which is part of the
+                           GNU Compiler Collection.")
+    ENDIF()
   ENDIF()
 
   SET(CTEST_COVERAGE_COMMAND "${GCOV_COMMAND}")
@@ -540,7 +547,10 @@ IF("${_res}" STREQUAL "0")
     IF(COVERAGE)
       CREATE_TARGETDIRECTORIES_TXT()
       MESSAGE("-- Running CTEST_COVERAGE()")
-      CTEST_COVERAGE()
+      #CTEST_COVERAGE()
+      FILE(DOWNLOAD "https://codecov.io/bash" "${CMAKE_CURRENT_BINARY_DIR}/tests/codecov-bash")
+      EXECUTE_PROCESS(COMMAND bash "${CMAKE_CURRENT_BINARY_DIR}/tests/codecov-bash"
+                              "-t ac85e7ce-5316-4bc1-a237-2fe724028c7b" "-x '${GCOV_COMMAND}'")
       CLEAR_TARGETDIRECTORIES_TXT()
     ENDIF(COVERAGE)
 
@@ -583,4 +593,4 @@ IF("${_res}" STREQUAL "0")
   MESSAGE("-- Submission successful. Goodbye!")
 ENDIF()
 
-# .oO( This script is freaky 584 lines long... )
+# .oO( This script is freaky 596 lines long... )

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.