]> gitweb.hhaalo.de Git - feierabend.git/commitdiff
add cppcheck analyse after tests
authorBastian Dehn <hhaalo@arcor.de>
Tue, 11 Nov 2025 18:29:56 +0000 (19:29 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 11 Nov 2025 18:29:56 +0000 (19:29 +0100)
tests/CMakeLists.txt

index 5179edc4f6b19f197696a58afcc04de59f6393dd..7342135df973daa84f107ed4ff97faff04c2180d 100644 (file)
@@ -1,6 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1)
 
 FIND_LIBRARY(CMOCKA cmocka REQUIRED)
+FIND_PROGRAM(CPPCHECK cppcheck REQUIRED)
 
 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
 
@@ -29,4 +30,12 @@ ADD_CUSTOM_TARGET(run_tests
        COMMAND ./time_format_tests
        DEPENDS break_tests
        worktime_tests
-       time_format_tests)
\ No newline at end of file
+       time_format_tests)
+
+ADD_CUSTOM_COMMAND(TARGET run_tests
+       POST_BUILD
+       COMMAND ${CPPCHECK}
+               --check-level=exhaustive
+               --enable=warning,style
+               ${CMAKE_SOURCE_DIR}/src
+               ${CMAKE_SOURCE_DIR}/tests)
\ No newline at end of file