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