Skip to content

Commit

Permalink
Log make -q command lines the outcome file
Browse files Browse the repository at this point in the history
As a debugging help, log the `make` command line in the outcome file. This
is not accurate if a command line argument contains some special
characters, but good enough to help debugging. Hopefully this will only be
temporary.

Signed-off-by: Gilles Peskine <[email protected]>
  • Loading branch information
gilles-peskine-arm committed Oct 30, 2024
1 parent f8f1925 commit b3940ab
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/scripts/quiet/make
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ TOOL="make"
. "$(dirname "$0")/quiet.sh"
EXIT_STATUS=$?

nl='
' # set the variable to a newline

log_outcome () {
targets=
skip=
Expand Down Expand Up @@ -57,7 +60,19 @@ log_outcome () {
else
result=FAIL
fi
cause= # Identifying failure causes would be nice, but difficult

# Identifying failure causes would be nice, but difficult.
# To help diagnose the tracing and our analysis of the traces in
# outcome analysis, log the full make command line in the "cause"
# column. Once tracing is more mature, I hope this won't be useful
# any longer.
cause="$*"
case "$cause" in
*[${nl}\\\;\"]*)
# Truncate command lines containing special characters that
# we don't want in the outcome file.
cause=${cause%%[${nl}\\\;\"]*}...;;
esac

for target in $targets; do
case "$target" in
Expand Down

0 comments on commit b3940ab

Please sign in to comment.