3
STRACEDIR=meson-logs/strace/$(for i in $@; do basename -z -- $i; echo -n _; done)
7
# If the test times out, meson sends SIGTERM to this process.
8
# Simply exec'ing "time" would result in no output from that in this case.
9
# Instead, we need to run "time" in the background, catch the signals and
10
# propagate them to the actual test process.
12
/usr/bin/time -v strace -ff -tt -T -o $STRACEDIR/log "$@" &
14
STRACEPID=$(ps --ppid $TIMEPID -o pid=)
15
TESTPID=$(ps --ppid $STRACEPID -o pid=)
17
if test "x$TESTPID" != x; then
18
trap 'kill -TERM $TESTPID; wait $TIMEPID; exit $?' TERM
24
# Only keep strace logs if the test timed out