Skip to content

Commit 15659a3

Browse files
committed
bug fix lcov error during code-coverage.
1 parent 59fa0ea commit 15659a3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if(BUILD_CODE_COVERAGE)
5151
include(CodeCoverage)
5252
APPEND_COVERAGE_COMPILER_FLAGS()
5353
# Exclude all code not directly generated by user from code coverage
54-
set(COVERAGE_GCOVR_EXCLUDES
54+
set(COVER_GCOVR_EXCLUDES
5555
"/usr/*"
5656
"${PROJECT_SOURCE_DIR}/test/*"
5757
"${PROJECT_SOURCE_DIR}/extern/*"
@@ -65,14 +65,17 @@ if(BUILD_CODE_COVERAGE)
6565
)
6666
# Create target for code coverage
6767
SETUP_TARGET_FOR_COVERAGE_LCOV(
68-
NAME code-coverage
69-
EXECUTABLE sh ${test_runner}
70-
DEPENDS ${test_runner}
68+
NAME code-coverage
69+
EXECUTABLE sh ${test_runner}
70+
DEPENDS ${test_runner}
71+
EXCLUDE ${COVER_GCOVR_EXCLUDES}
72+
LCOV_ARGS "--ignore-errors" "mismatch"
7173
)
7274
SETUP_TARGET_FOR_COVERAGE_GCOVR_XML(
73-
NAME code-coverage-gcov
74-
EXECUTABLE sh ${test_runner}
75-
DEPENDS ${test_runner}
75+
NAME code-coverage-gcov
76+
EXECUTABLE sh ${test_runner}
77+
DEPENDS ${test_runner}
78+
EXCLUDE ${COVER_GCOVR_EXCLUDES}
7679
)
7780
endif()
7881

0 commit comments

Comments
 (0)