3 if [ "$#" -eq 0 ]; then
4 echo "Usage: $0 fmt..." >&2
8 # Honor the SPEED environment variable, just like we do it for "meson test"
10 if [ "$SPEED" = "slow" ] ||
[ "$SPEED" = "thorough" ]; then
21 if grep -q "CONFIG_GPROF=y" config-host.mak
2>/dev
/null
; then
22 skip
"GPROF is enabled ==> Not running the qemu-iotests."
25 # Disable tests with any sanitizer except for specific ones
26 SANITIZE_FLAGS
=$
( grep "CFLAGS.*-fsanitize" config-host.mak
2>/dev
/null
)
27 ALLOWED_SANITIZE_FLAGS
="safe-stack cfi-icall"
28 #Remove all occurrencies of allowed Sanitize flags
29 for j
in ${ALLOWED_SANITIZE_FLAGS}; do
30 TMP_FLAGS
=${SANITIZE_FLAGS}
32 for i
in ${TMP_FLAGS}; do
33 if ! echo ${i} |
grep -q "${j}" 2>/dev
/null
; then
34 SANITIZE_FLAGS
="${SANITIZE_FLAGS} ${i}"
38 if echo ${SANITIZE_FLAGS} |
grep -q "\-fsanitize" 2>/dev
/null
; then
39 # Have a sanitize flag that is not allowed, stop
40 skip
"Sanitizers are enabled ==> Not running the qemu-iotests."
43 if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then
44 skip
"No qemu-system binary available ==> Not running the qemu-iotests."
47 if ! command -v bash
>/dev
/null
2>&1 ; then
48 skip
"bash not available ==> Not running the qemu-iotests."
51 if LANG
=C bash
--version |
grep -q 'GNU bash, version [123]' ; then
52 skip
"bash version too old ==> Not running the qemu-iotests."
55 if ! (sed --version |
grep 'GNU sed') > /dev
/null
2>&1 ; then
56 if ! command -v gsed
>/dev
/null
2>&1; then
57 skip
"GNU sed not available ==> Not running the qemu-iotests."
60 # Double-check that we're not using BusyBox' sed which says
61 # that "This is not GNU sed version 4.0" ...
62 if sed --version |
grep -q 'not GNU sed' ; then
63 skip
"BusyBox sed not supported ==> Not running the qemu-iotests."
69 # QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
70 export QEMU_CHECK_BLOCK_AUTO
=1
72 # If make was called with -jN we want to call ./check with -j N. Extract the
73 # flag from MAKEFLAGS, so that if it absent (or MAKEFLAGS is not defined), JOBS
74 # would be an empty line otherwise JOBS is prepared string of flag with value:
76 # Note, that the following works even if make was called with "-j N" or even
77 # "--jobs N", as all these variants becomes simply "-jN" in MAKEFLAGS variable.
78 JOBS
=$
(echo "$MAKEFLAGS" |
sed -n 's/\(^\|.* \)-j\([0-9]\+\)\( .*\|$\)/-j \2/p')
81 for fmt in $format_list ; do
82 ${PYTHON} .
/check
$JOBS -tap -$fmt $group || ret
=1