]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change custom commands after running tests
authorBastian Dehn <hhaalo@arcor.de>
Fri, 7 Nov 2025 19:38:24 +0000 (20:38 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 7 Nov 2025 19:38:24 +0000 (20:38 +0100)
tests/CMakeLists.txt

index d46b5c335a74c18c857e80daa8939c95bfedd109..db92439495a34da71c27c7d8ff2982e16c71aace 100644 (file)
@@ -107,22 +107,20 @@ add_custom_target(runningtests
                kds_s2000w_image_converter_tests
                kds_s2000w_pixel_converter_tests)
 
-add_custom_target(cppcheck
-       ALL ${CPPCHECK}
+add_custom_command(TARGET runningtests
+       POST_BUILD
+       COMMAND ${CPPCHECK}
                --check-level=exhaustive
                --enable=warning,style
                --inline-suppr
                --error-exitcode=1
                ${CMAKE_SOURCE_DIR}/src
-               ${CMAKE_SOURCE_DIR}/tests
-       DEPENDS runningtests)
+               ${CMAKE_SOURCE_DIR}/tests)
 
-add_custom_target(generate_gcov_coverage
-       ALL gcov ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir/*.c.o
-       DEPENDS runningtests)
-
-add_custom_target(generate_lcov_coverage
-       ALL lcov
+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*
@@ -131,10 +129,6 @@ add_custom_target(generate_lcov_coverage
                --exclude kds_s2000w_debug.c
                --exclude kds_s2000w_image_converter*.c
                --output-file ${CMAKE_BINARY_DIR}/coverage.info
-       DEPENDS generate_gcov_coverage)
-
-add_custom_target(generate_html_coverage
-       ALL genhtml
+       COMMAND genhtml
                --output-directory ${CMAKE_BINARY_DIR}/coverage
-               ${CMAKE_BINARY_DIR}/coverage.info
-       DEPENDS generate_lcov_coverage)
\ No newline at end of file
+               ${CMAKE_BINARY_DIR}/coverage.info)
\ No newline at end of file