3
# If the test times out, meson sends SIGTERM to this process.
4
# Simply exec'ing "time" would result in no output from that in this case.
5
# Instead, we need to run "time" in the background, catch the signals and
6
# propagate them to the actual test process.
8
/usr/bin/time -v "$@" &
10
TESTPID=$(ps --ppid $TIMEPID -o pid=)
12
if test "x$TESTPID" != x; then
13
trap 'kill -TERM $TESTPID; wait $TIMEPID; exit $?' TERM