]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
coccinelle: add option to continue on errors
authorEric Leblond <eric@regit.org>
Mon, 9 Dec 2013 17:18:30 +0000 (18:18 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 10 Dec 2013 10:35:09 +0000 (11:35 +0100)
When a script has been updated or introduced, it is interesting to
detect all errors at once. With this patch it is now possible to
do so by using:
   NOT_TERMINAL=1 CONCURRENCY_LEVEL=12  qa/coccinelle/run_check.sh

qa/coccinelle/run_check.sh

index da6d410e7c5c2f61261433eecfcc89d5ce7ef980..79ec9cc6f0fee79f98e8864e2867f4f26c8adfb3 100755 (executable)
@@ -29,10 +29,10 @@ fi
 for SMPL in $(git rev-parse --show-toplevel)/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{} || exit 1;
+               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
        else
                for FILE in $LIST ; do
-                       spatch --very-quiet -sp_file $SMPL --undefined UNITTESTS  $PREFIX$FILE || exit 1;
+                       spatch --very-quiet -sp_file $SMPL --undefined UNITTESTS  $PREFIX$FILE || if [ -z "$NOT_TERMINAL" ]; then exit 1; fi
                done
        fi
 done