From 5ba6e71420bef55ca676e680041c823e1f082ec7 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 26 Jul 2026 08:37:38 +0200 Subject: [PATCH] change code coverage at the end of tests --- tests/CMakeLists.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index afe0b53..4dba852 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,27 +35,12 @@ add_custom_target(runningtests ALL ./tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS tests) -add_custom_command(TARGET runningtests - POST_BUILD - COMMAND gcov ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir/*.c.o - COMMAND lcov - --capture - --directory ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir - --exclude include* - --exclude kds_s2000w_client.c - --exclude kds_s2000w_heartbeat.c - --exclude kds_s2000w_debug.c - --exclude kds_s2000w_image_converter*.c - --output-file ${CMAKE_BINARY_DIR}/coverage.info - COMMAND genhtml - --output-directory ${CMAKE_BINARY_DIR}/coverage - ${CMAKE_BINARY_DIR}/coverage.info) + add_custom_command(TARGET runningtests POST_BUILD COMMAND BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ./postinst.bats COMMAND BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} ./postrm.bats WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - if(CPPCHECK_VERSION VERSION_GREATER 2.10) add_custom_command(TARGET runningtests POST_BUILD @@ -75,4 +60,19 @@ else() --error-exitcode=1 ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests) -endif() \ No newline at end of file +endif() +add_custom_command(TARGET runningtests + POST_BUILD + COMMAND gcov ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir/*.c.o + COMMAND lcov + --capture + --directory ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir + --exclude include* + --exclude kds_s2000w_client.c + --exclude kds_s2000w_heartbeat.c + --exclude kds_s2000w_debug.c + --exclude kds_s2000w_image_converter*.c + --output-file ${CMAKE_BINARY_DIR}/coverage.info + COMMAND genhtml + --output-directory ${CMAKE_BINARY_DIR}/coverage + ${CMAKE_BINARY_DIR}/coverage.info) \ No newline at end of file -- 2.47.3