From 91213d5ec8889409a6e3de6a365c478140801eec Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 3 Feb 2011 20:05:41 +0100 Subject: [PATCH] Add option to run_check script If given an argument run_check.sh will test this file against the cocci patches. --- qa/coccinelle/run_check.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/qa/coccinelle/run_check.sh b/qa/coccinelle/run_check.sh index 165ec92535..7cf2030eb6 100755 --- a/qa/coccinelle/run_check.sh +++ b/qa/coccinelle/run_check.sh @@ -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