Skip to content

Commit 9302507

Browse files
committed
Error message from GCOV
Issue : #22 To suppress the error message, eplicitly delete the *.gcda.
1 parent d3cead3 commit 9302507

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
### Added
99
### Changed
1010
### Fixed
11+
- [Issue #22](https://github.com/suikan4github/template_application/issues/22) : Error message from GCOV
1112

1213
## [1.4.0] - 2022-01-22
1314
### Added

test/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ set(TEST_EXECUTABLE_NAME test_${PROJECT_NAME})
1919
# Add the executable for the testcase which is using googletest
2020
add_executable(${TEST_EXECUTABLE_NAME} ${TEST_SRC} ${LIB_SRC})
2121

22+
# Delete the gcov data file before linking. Otherwise, we will get many errors.
23+
add_custom_command(
24+
TARGET ${TEST_EXECUTABLE_NAME} PRE_LINK
25+
COMMAND find . -name "*.gcda" -delete
26+
COMMENT "Deleting *.gcda files under ${CMAKE_BINARY_DIR}"
27+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
28+
VERBATIM)
29+
2230
# Add the library under test.
2331
target_link_libraries(${TEST_EXECUTABLE_NAME}
2432
"gtest_main"

0 commit comments

Comments
 (0)