Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 67506834 authored by hhakim's avatar hhakim
Browse files

Limit gcov flags to ctest ci job (C++ tests).

parent 70a95dde
Branches
Tags
No related merge requests found
......@@ -38,7 +38,7 @@ stages:
- conda_pkgs
ctest:
variables: {SLOW_TESTS: "OFF", BUILD_MULTITHREAD: "ON"} # the CDashConfScript is able to retrieve OpenMP_gomp_LIBRARY and OpenMP_INC_DIR from environment (it's necessary on macOS, so the runner's env. must be configured)
variables: {SLOW_TESTS: "OFF", BUILD_MULTITHREAD: "ON", GCOV_FLAGS: "ON"} # the CDashConfScript is able to retrieve OpenMP_gomp_LIBRARY and OpenMP_INC_DIR from environment (it's necessary on macOS, so the runner's env. must be configured)
coverage: '/Coverage: \d+\.\d+\%/'
script:
- ctest -O ctest.log -S ./CDashConfScript.cmake -j4 --output-junit junit_output.xml
......
......@@ -491,11 +491,13 @@ else()
message(STATUS "Failed to determine the compiler ${CMAKE_CXX_COMPILER} C++11 flag.")
endif()
if(BUILD_TESTING)
# coverage flags (for gcov and gcovr)
# we don't disable optimization because many tests would be too slow
# unfortunately the coverage measure should be less precise
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" CACHE STRING "compile flags" FORCE)
if(BUILD_TESTING AND DEFINED ENV{GCOV_FLAGS})
if($ENV{GCOV_FLAGS} MATCHES "ON")
# coverage flags (for gcov and gcovr)
# we don't disable optimization because many tests would be too slow
# unfortunately the coverage measure should be less precise
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" CACHE STRING "compile flags" FORCE)
endif()
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment