]> git.proxmox.com Git - mirror_qemu.git/blame - tests/check-block.sh
Clean up ill-advised or unusual header guards
[mirror_qemu.git] / tests / check-block.sh
CommitLineData
b8c6f29e
KW
1#!/bin/sh
2
18c1cdd2
PB
3if [ "$#" -eq 0 ]; then
4 echo "Usage: $0 fmt..." >&2
5 exit 99
6fi
7
98487b90 8# Honor the SPEED environment variable, just like we do it for "meson test"
18c1cdd2
PB
9format_list="$@"
10if [ "$SPEED" = "slow" ] || [ "$SPEED" = "thorough" ]; then
bdd95e47
TH
11 group=
12else
bdd95e47
TH
13 group="-g auto"
14fi
15
98487b90 16skip() {
d316859f
PB
17 echo "1..0 #SKIP $*"
18 exit 0
98487b90
PB
19}
20
bdd95e47 21if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then
98487b90 22 skip "No qemu-system binary available ==> Not running the qemu-iotests."
bdd95e47
TH
23fi
24
7467d94c 25cd tests/qemu-iotests
b8c6f29e 26
33fe08fc
TH
27# QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
28export QEMU_CHECK_BLOCK_AUTO=1
f203080b 29export PYTHONUTF8=1
bcda7b17
VSO
30# If make was called with -jN we want to call ./check with -j N. Extract the
31# flag from MAKEFLAGS, so that if it absent (or MAKEFLAGS is not defined), JOBS
32# would be an empty line otherwise JOBS is prepared string of flag with value:
33# "-j N"
34# Note, that the following works even if make was called with "-j N" or even
35# "--jobs N", as all these variants becomes simply "-jN" in MAKEFLAGS variable.
36JOBS=$(echo "$MAKEFLAGS" | sed -n 's/\(^\|.* \)-j\([0-9]\+\)\( .*\|$\)/-j \2/p')
33fe08fc 37
b8c6f29e 38ret=0
bdd95e47 39for fmt in $format_list ; do
d316859f 40 ${PYTHON} ./check $JOBS -tap -$fmt $group || ret=1
c2519009 41done
b8c6f29e
KW
42
43exit $ret