2016-11-13 12:37:22 +00:00
|
|
|
#!/bin/sh
|
2016-11-26 10:23:25 +00:00
|
|
|
method=$1
|
2016-11-13 12:37:22 +00:00
|
|
|
img=$2
|
|
|
|
timeout=$3
|
2016-11-29 19:59:43 +00:00
|
|
|
timeoutprog=$4
|
2016-11-13 12:37:22 +00:00
|
|
|
|
2018-06-03 13:13:43 +00:00
|
|
|
set -e
|
|
|
|
|
2016-11-29 19:59:43 +00:00
|
|
|
errcho() {
|
|
|
|
>&2 echo "$*"
|
|
|
|
}
|
|
|
|
|
|
|
|
get_test_output() {
|
|
|
|
case $method in
|
|
|
|
qemu-*)
|
2023-02-13 22:21:42 +00:00
|
|
|
errcho "qemu tests no longer supported (method $method)"
|
|
|
|
exit 1
|
2016-11-29 19:59:43 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2018-06-03 13:13:43 +00:00
|
|
|
$timeoutprog -t $timeout -- $method $img 2>&1
|
2016-11-29 19:59:43 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2017-11-08 19:08:43 +00:00
|
|
|
# Hide output if the test passed.
|
|
|
|
# Show output if it failed, skipped, or timed out.
|
|
|
|
get_test_output | awk '
|
|
|
|
{ lines[count++] = $0 }
|
|
|
|
/@@FAIL|@@SKIPPED|@@TIMEDOUT/ { bad = 1 }
|
|
|
|
/@@FINISHED/ { finished = 1 }
|
|
|
|
END {
|
|
|
|
if (finished && !bad) exit 0
|
|
|
|
for (i = 0; i < count; i++) print lines[i]
|
|
|
|
if (!bad) print "@@FAIL by testdriver.sh"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
'
|