~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to .gitlab-ci/meson/time.sh

  • Committer: mmach
  • Date: 2022-09-22 19:56:13 UTC
  • Revision ID: netbit73@gmail.com-20220922195613-wtik9mmy20tmor0i
2022-09-22 21:17:09

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
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.
7
 
 
8
 
/usr/bin/time -v "$@" &
9
 
TIMEPID=$!
10
 
TESTPID=$(ps --ppid $TIMEPID -o pid=)
11
 
 
12
 
if test "x$TESTPID" != x; then
13
 
    trap 'kill -TERM $TESTPID; wait $TIMEPID; exit $?' TERM
14
 
fi
15
 
 
16
 
wait $TIMEPID
17
 
exit $?