mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-26 05:58:11 +02:00
In jobs where the wrapper isn't used, this leaves the <build directory>/meson-logs/testlog.txt filename unchanged. Also prepares for using different wrapper scripts in different jobs. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9472>
17 lines
459 B
Bash
Executable file
17 lines
459 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# If the test times out, meson sends SIGTERM to this process.
|
|
# Simply exec'ing "time" would result in no output from that in this case.
|
|
# Instead, we need to run "time" in the background, catch the signals and
|
|
# propagate them to the actual test process.
|
|
|
|
/usr/bin/time -v "$@" &
|
|
TIMEPID=$!
|
|
TESTPID=$(ps --ppid $TIMEPID -o pid=)
|
|
|
|
if test "x$TESTPID" != x; then
|
|
trap 'kill -TERM $TESTPID; wait $TIMEPID; exit $?' TERM
|
|
fi
|
|
|
|
wait $TIMEPID
|
|
exit $?
|