Print diff in case of clang-format output

This commit is contained in:
Evgenii Zheltonozhskii 2018-10-31 09:27:36 +02:00 committed by Stanislav Ershov
parent 1b9b2bbeed
commit 79367a7760
2 changed files with 7 additions and 8 deletions

View File

@ -5,6 +5,12 @@ set -x
cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $EXTRA_CMAKE_FLAGS -DBUILD_TESTING=ON .. || exit 1 cmake -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE $EXTRA_CMAKE_FLAGS -DBUILD_TESTING=ON .. || exit 1
# grep returns number of items found. each change is enclosed into <replacement> # grep returns number of items found. each change is enclosed into <replacement>
# tag in the xml. Thus if no changes needed, 0 will be returned # tag in the xml. Thus if no changes needed, 0 will be returned
cmake --build . --target clang-format-ci -- -v | grep -c "<replacement " && exit 1 cmake --build . --target clang-format -- -v
if [[ $(git diff) ]]; then
git diff | cat
exit 1
else
echo "Success!"
fi
cmake --build . -- -v || exit 1 cmake --build . -- -v || exit 1
ASAN_OPTIONS=alloc_dealloc_mismatch=0 ctest . || exit 1 ASAN_OPTIONS=alloc_dealloc_mismatch=0 ctest . || exit 1

View File

@ -19,13 +19,6 @@ if(CLANG_FORMAT)
-style=file -style=file
${ALL_CXX_SOURCE_FILES} ${ALL_CXX_SOURCE_FILES}
) )
add_custom_target(
clang-format-ci
COMMAND clang-format
-output-replacements-xml
-style=file
${ALL_CXX_SOURCE_FILES}
)
endif() endif()
# Adding clang-tidy target if executable is found # Adding clang-tidy target if executable is found