Skip to content

Commit

Permalink
Updated cppcheck script
Browse files Browse the repository at this point in the history
  • Loading branch information
leanfrancucci committed Dec 23, 2020
1 parent 9d6b611 commit 5d8d894
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tools/analyzer/cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ source_dir="../../source"
cppcheck_dir="tools/analyzer"
modules="fwk mempool queue sm sma tmr trc"
additional="../demo/cross/blinky portable/test/"
flags="--quiet --error-exitcode=1 --language=c --enable=performance,information,missingInclude"
flags="--error-exitcode=1 --language=c --enable=performance,information,missingInclude"
defines="__TEST__"

#echo $PATH
#export PATH="$PATH:/home/travis/.rvm/gems/ruby-2.4.1/bin"
#echo $PATH
#which ceedling
#exit 0
output=""

if [ ! -d $source_dir ]; then
echo "[ERROR] This script must be invoked from "$uno_dir
exit 1
fi

if [ ! -z $1 ]; then
flags+=" --xml --xml-version=2 --quiet"
output="../$cppcheck_dir/$1"
fi

currdir=$PWD
includes=()
sources=()
Expand All @@ -44,5 +44,8 @@ done

cd $source_dir
files="${sources[@]}"
cppcheck $flags -D$defines "${includes[@]}" $files

if [ -z $output ]; then
cppcheck $flags -D$defines "${includes[@]}" $files
else
cppcheck $flags -D$defines "${includes[@]}" $files 2> $output
fi

0 comments on commit 5d8d894

Please sign in to comment.