Skip to content

Commit 5303265

Browse files
Bernd Schubertmichal42
authored andcommitted
coccicheck: Allow to show the executed command line
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 <bernd.schubert@itwm.fraunhofer.de> CC: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Nicolas Palix <nicolas.palix@imag.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 26e5672 commit 5303265

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

‎scripts/coccicheck‎

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ if [ "$ONLINE" = "0" ] ; then
5555
echo ''
5656
fi
5757

58+
run_cmd() {
59+
if [ $VERBOSE -ne 0 ] ; then
60+
echo "Running: $@"
61+
fi
62+
eval $@
63+
}
64+
65+
5866
coccinelle () {
5967
COCCI="$1"
6068

@@ -100,15 +108,21 @@ coccinelle () {
100108
fi
101109

102110
if [ "$MODE" = "chain" ] ; then
103-
$SPATCH -D patch $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
104-
$SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
105-
$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
106-
$SPATCH -D org $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
111+
run_cmd $SPATCH -D patch \
112+
$FLAGS -sp_file $COCCI $OPT $OPTIONS || \
113+
run_cmd $SPATCH -D report \
114+
$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
115+
run_cmd $SPATCH -D context \
116+
$FLAGS -sp_file $COCCI $OPT $OPTIONS || \
117+
run_cmd $SPATCH -D org \
118+
$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
107119
elif [ "$MODE" = "rep+ctxt" ] ; then
108-
$SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
109-
$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
120+
run_cmd $SPATCH -D report \
121+
$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
122+
run_cmd $SPATCH -D context \
123+
$FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
110124
else
111-
$SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
125+
run_cmd $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
112126
fi
113127

114128
}

0 commit comments

Comments
 (0)