Commit 55901db2 authored by Jan Möbius's avatar Jan Möbius
Browse files

Updated ci cppcheck script

parent d3d58f26
#!/bin/bash
# Exit script on any error
set -e
#=====================================
# Color Settings:
#=====================================
NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "Running cppcheck"
echo "=============================================================================="
echo -e "${NC}"
echo "Started: $(date)"
echo "Please Wait ..."
# Run cppcheck and output into file
cppcheck --enable=all \
-j8 \
--quiet \
-i libs_required \
-i build-release \
-i build-debug \
-i .svn \
-i .git \
--force \
-UDOXY_IGNORE_THIS \
--suppress=unusedPrivateFunction \
--suppress=ConfigurationNotChecked \
--suppress=missingIncludeSystem \
-DOPENMESHDLLEXPORT="" \
-Umin -Umax -UBMPOSTFIX \
-DACGDLLEXPORT=""\
-DDLLEXPORTONLY=""\
. &> cppcheck.log
echo "Finished: $(date)"
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "CPPCHECK Messages"
echo "=============================================================================="
echo -e "${NC}"
# Echo output to command line for simple analysis via gitlab
cat cppcheck.log
COUNT=$(wc -l < cppcheck.log )
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
if [ $COUNT -gt 60 ]; then
echo -e ${WARNING}
echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed";
echo -e "${NC}"
exit 1;
else
echo "Total CPPCHECK error Count is $COUNT ... OK"
fi
...@@ -15,6 +15,7 @@ echo "========================================================================== ...@@ -15,6 +15,7 @@ echo "==========================================================================
echo "Running cppcheck" echo "Running cppcheck"
echo "==============================================================================" echo "=============================================================================="
echo -e "${NC}" echo -e "${NC}"
echo "Started: $(date)"
echo "Please Wait ..." echo "Please Wait ..."
# Run cppcheck and output into file # Run cppcheck and output into file
...@@ -22,8 +23,6 @@ cppcheck --enable=all \ ...@@ -22,8 +23,6 @@ cppcheck --enable=all \
-j4 \ -j4 \
--quiet \ --quiet \
-i libs_required \ -i libs_required \
-i Plugin-MemInfo/procps \
-i Plugin-PoissonReconstruction \
-i build-release \ -i build-release \
-i build-debug \ -i build-debug \
-i .svn \ -i .svn \
...@@ -32,14 +31,14 @@ cppcheck --enable=all \ ...@@ -32,14 +31,14 @@ cppcheck --enable=all \
-UDOXY_IGNORE_THIS \ -UDOXY_IGNORE_THIS \
--suppress=unusedPrivateFunction \ --suppress=unusedPrivateFunction \
--suppress=ConfigurationNotChecked \ --suppress=ConfigurationNotChecked \
--suppressions-list=tests/cppcheck-suppressions.txt \
--suppress=missingIncludeSystem \ --suppress=missingIncludeSystem \
-DOPENMESHDLLEXPORT="" \ -DOPENMESHDLLEXPORT="" \
-Umin -Umax -UBMPOSTFIX \ -Umin -Umax -UBMPOSTFIX \
-DACGDLLEXPORT=""\ -DACGDLLEXPORT=""\
. -DDLLEXPORTONLY=""\
#&> cppcheck.log . &> cppcheck.log
echo "Finished: $(date)"
echo -e "${OUTPUT}" echo -e "${OUTPUT}"
echo "==============================================================================" echo "=============================================================================="
...@@ -59,7 +58,7 @@ echo "CPPCHECK Summary" ...@@ -59,7 +58,7 @@ echo "CPPCHECK Summary"
echo "==============================================================================" echo "=============================================================================="
echo -e "${NC}" echo -e "${NC}"
if [ $COUNT -gt 0 ]; then if [ $COUNT -gt 60 ]; then
echo -e ${WARNING} echo -e ${WARNING}
echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed"; echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed";
echo -e "${NC}" echo -e "${NC}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment