Skip to content

Commit 7797d98

Browse files
committed
Update CMakeLists.txt
Update CMakeLists.txt to fix code coverage for latest lcov version
1 parent dd62f0f commit 7797d98

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,7 @@ if (ENABLE_COVERAGE)
273273
)
274274

275275
target_link_libraries(
276-
GameAnalytics
277-
PRIVATE
278-
--coverage
276+
GameAnalytics PRIVATE -fprofile-arcs -ftest-coverage
279277
)
280278

281279
set(covname cov)
@@ -289,13 +287,22 @@ if (ENABLE_COVERAGE)
289287
COMMAND GameAnalyticsUnitTests
290288

291289
# Capturing lcov counters and generating report
292-
COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info
290+
291+
COMMAND echo "Processing code coverage counters and generating report."
292+
293+
COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --rc geninfo_unexecuted_blocks=1 --rc no_exception_branch=1
294+
295+
COMMAND echo "Removing unwanted files from coverage report."
296+
293297
COMMAND ${LCOV_PATH} --remove ${covname}.info
294298
'${CMAKE_SOURCE_DIR}/source/dependencies/*'
295299
'${CMAKE_SOURCE_DIR}/test/*'
296300
'/usr/*'
297301
'/Applications/Xcode.app/*'
298302
--output-file ${covname}.info.cleaned
303+
--ignore-errors unused
304+
305+
COMMAND echo "Finished processing code coverage counters and generating report."
299306
)
300307

301308
if (GENHTML_PATH)

0 commit comments

Comments
 (0)