Skip to content

Commit

Permalink
coccicheck: Allow to show the executed command line
Browse files Browse the repository at this point in the history
On my system one of the tests failed with
"Fatal error: exception Failure("No OCaml compiler found! Install either ocamlopt or ocamlopt.opt")".

Investigating such issues is easier if the executed command line is
being shown.

Signed-off-by: Bernd Schubert <[email protected]>
CC: Julia Lawall <[email protected]>
Acked-by: Nicolas Palix <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
Bernd Schubert authored and michal42 committed Feb 22, 2013
1 parent 26e5672 commit 5303265
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions scripts/coccicheck
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ if [ "$ONLINE" = "0" ] ; then
echo ''
fi

run_cmd() {
if [ $VERBOSE -ne 0 ] ; then
echo "Running: $@"
fi
eval $@
}


coccinelle () {
COCCI="$1"

Expand Down Expand Up @@ -100,15 +108,21 @@ coccinelle () {
fi

if [ "$MODE" = "chain" ] ; then
$SPATCH -D patch $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
$SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
$SPATCH -D org $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
run_cmd $SPATCH -D patch \
$FLAGS -sp_file $COCCI $OPT $OPTIONS || \
run_cmd $SPATCH -D report \
$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
run_cmd $SPATCH -D context \
$FLAGS -sp_file $COCCI $OPT $OPTIONS || \
run_cmd $SPATCH -D org \
$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
elif [ "$MODE" = "rep+ctxt" ] ; then
$SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
run_cmd $SPATCH -D report \
$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
run_cmd $SPATCH -D context \
$FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
else
$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
run_cmd $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
fi

}
Expand Down

0 comments on commit 5303265

Please sign in to comment.