diff --git a/cmake/check-coding-style.sh b/cmake/check-coding-style.sh index 26bb997f15b4cc3ff7598a1c24fc3962ccb2625e..ad99511c0abad35afc3f36c621e2514cdedd9742 100755 --- a/cmake/check-coding-style.sh +++ b/cmake/check-coding-style.sh @@ -18,6 +18,7 @@ if which clang-format-14 > /dev/null; then echo "Code formatting incorrect!" fi else + echo 77 > "${ERRFILE}" echo "WARNING: clang-format-14 not found, code formatting not checked!" fi diff --git a/cmake/enable_code_style_check.cmake b/cmake/enable_code_style_check.cmake index efac67d7096f488fa9f888ab794e268e3259f3d2..80dda5ab649745e790a66463a058f3d76adbec2e 100644 --- a/cmake/enable_code_style_check.cmake +++ b/cmake/enable_code_style_check.cmake @@ -20,3 +20,6 @@ enable_testing() add_test(NAME coding_style COMMAND ${CMAKE_SOURCE_DIR}/cmake/check-coding-style.sh ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +# coding style will return 77 if no clang-format-14 could be found AND none of the other tests fail +set_property(TEST coding_style PROPERTY SKIP_RETURN_CODE 77)