Add option to run_check script

If given an argument run_check.sh will test this file against
the cocci patches.
remotes/origin/master-1.1.x
Eric Leblond 15 years ago committed by Victor Julien
parent 0cf05856d0
commit 91213d5ec8

@ -1,9 +1,16 @@
#!/bin/sh
if [ $1 ]; then
LIST=$1;
else
LIST=$(git ls-tree -r --name-only --full-tree HEAD src/ | grep -E '*.c$')
PREFIX="../../"
fi
for SMPL in *.cocci; do
echo "Testing cocci file: $SMPL"
for FILE in $(git ls-tree -r --name-only --full-tree HEAD src/ | grep -E '*.c$') ; do
spatch -sp_file $SMPL ../../$FILE 2>/dev/null || exit 1;
for FILE in $LIST ; do
spatch -sp_file $SMPL $PREFIX$FILE 2>/dev/null || exit 1;
done
done

Loading…
Cancel
Save