* init.sh (run_prog, run_prog_skip_if_failed): When the program fails,
add its exit code to the diagnostic message.
(run_strace): When strace fails, add its exit code to the diagnostic
message.
(run_strace_merge): When strace-log-merge fails, add its exit code
to the diagnostic message.
fi
args="$*"
"$@" || {
- if [ $? -eq 77 ]; then
+ rc=$?
+ if [ $rc -eq 77 ]; then
skip_ "$args exited with code 77"
else
- fail_ "$args failed"
+ fail_ "$args failed with code $rc"
fi
}
}
run_prog_skip_if_failed()
{
args="$*"
- "$@" || framework_skip_ "$args failed"
+ "$@" || framework_skip_ "$args failed with code $?"
}
run_strace()
> "$LOG" || fail_ "failed to write $LOG"
args="$*"
$STRACE -o "$LOG" "$@" ||
- dump_log_and_fail_with "$STRACE $args failed"
+ dump_log_and_fail_with "$STRACE $args failed with code $?"
}
run_strace_merge()
rm -f -- "$LOG".[0-9]*
run_strace -ff -tt "$@"
"$srcdir"/../strace-log-merge "$LOG" > "$LOG" ||
- dump_log_and_fail_with 'strace-log-merge failed'
+ dump_log_and_fail_with 'strace-log-merge failed with code $?'
rm -f -- "$LOG".[0-9]*
}