@ -4,6 +4,7 @@ if [ $1 ]; then
case $1 in
*[ ch] )
LIST = $@ ;
PREFIX = $( git rev-parse --show-toplevel) /
; ;
*..*)
LIST = $( git diff --pretty= "format:" --name-only $1 | grep -E '[ch]$' )
@ -14,9 +15,12 @@ if [ $1 ]; then
PREFIX = $( git rev-parse --show-toplevel) /
; ;
esac
el se
el if git rev-par se > /dev/null 2>& 1; then
LIST = $( git ls-tree -r --name-only --full-tree HEAD src/ | grep -E '*.c$' )
PREFIX = $( git rev-parse --show-toplevel) /
elif [ " ${ TOP_SRCDIR } " != "" ] ; then
LIST = $( cd ${ TOP_SRCDIR } && find src -name \* .[ ch] )
PREFIX = ${ TOP_SRCDIR } /
fi
if [ -z " $CONCURRENCY_LEVEL " ] ; then
@ -26,7 +30,7 @@ else
echo " Using concurrency level $CONCURRENCY_LEVEL "
fi
for SMPL in $( git rev-parse --show-toplevel) / qa/coccinelle/*.cocci; do
for SMPL in ${ PREFIX } qa/coccinelle/*.cocci; do
echo " Testing cocci file: $SMPL "
if command -v parallel >/dev/null; then
echo -n $LIST | parallel -d ' ' -j $CONCURRENCY_LEVEL spatch --very-quiet -sp_file $SMPL --undefined UNITTESTS $PREFIX { } || if [ -z " $NOT_TERMINAL " ] ; then exit 1; fi