diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ddd0cc2..da4bc8de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,3 +27,8 @@ macos-c++98: script: "CI/ci-mac.sh C++98" tags: - Apple + +cppcheck: + script: "CI/ci-cppcheck.sh" + tags: + - Linux diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh new file mode 100755 index 00000000..79a7eb58 --- /dev/null +++ b/CI/ci-cppcheck.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Run cppcheck and output into file +cppcheck --enable=all . -I src -i Doc/ --force --suppress=unusedFunction --quiet vi src/OpenMesh/Tools/Utils/Timer.hh -Umin -Umax -UBMPOSTFIX -DOPENMESHDLLEXPORT="" &> cppcheck.log + +# Echo output to command line for simple analysis via gitlab +cat cppcheck.log + +COUNT=$(wc -l < cppcheck.log ) + +if [ $COUNT -gt 1 ]; then + echo "Error Count is $COUNT which is too High! CPPCHECK Run failed"; + exit 1; +else + echo "Error Count is $COUNT ... OK" +fi + +