blob: 679aedec50c9aeade6035bf261d185c3ae4120be [file] [log] [blame]
Kevin Wolfb8c6f292012-03-09 13:37:40 +01001#!/bin/sh
2
Thomas Huthbdd95e42019-07-12 17:39:33 +02003# Honor the SPEED environment variable, just like we do it for the qtests.
4if [ "$SPEED" = "slow" ]; then
5 format_list="raw qcow2"
6 group=
7elif [ "$SPEED" = "thorough" ]; then
8 format_list="raw qcow2 qed vmdk vpc"
9 group=
10else
11 format_list=qcow2
12 group="-g auto"
Denis V. Lunevc2519002016-09-15 19:42:49 +030013fi
14
Thomas Huthbdd95e42019-07-12 17:39:33 +020015if [ "$#" -ne 0 ]; then
16 format_list="$@"
17fi
Kevin Wolfb8c6f292012-03-09 13:37:40 +010018
Thomas Huthbdd95e42019-07-12 17:39:33 +020019if grep -q "TARGET_GPROF=y" *-softmmu/config-target.mak 2>/dev/null ; then
20 echo "GPROF is enabled ==> Not running the qemu-iotests."
21 exit 0
22fi
23
Thomas Huth2cc4d1c2019-08-23 10:42:03 +020024if grep -q "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ; then
25 echo "Sanitizers are enabled ==> Not running the qemu-iotests."
26 exit 0
27fi
28
Thomas Huthbdd95e42019-07-12 17:39:33 +020029if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then
30 echo "No qemu-system binary available ==> Not running the qemu-iotests."
31 exit 0
32fi
33
34if ! command -v bash >/dev/null 2>&1 ; then
35 echo "bash not available ==> Not running the qemu-iotests."
36 exit 0
37fi
38
39if ! (sed --version | grep 'GNU sed') > /dev/null 2>&1 ; then
40 if ! command -v gsed >/dev/null 2>&1; then
41 echo "GNU sed not available ==> Not running the qemu-iotests."
42 exit 0
43 fi
Kevin Wolfb8c6f292012-03-09 13:37:40 +010044fi
45
Paolo Bonzini7467d942015-12-23 11:42:21 +010046cd tests/qemu-iotests
Kevin Wolfb8c6f292012-03-09 13:37:40 +010047
48ret=0
Thomas Huthbdd95e42019-07-12 17:39:33 +020049for fmt in $format_list ; do
50 ./check -makecheck -$fmt $group || ret=1
Denis V. Lunevc2519002016-09-15 19:42:49 +030051done
Kevin Wolfb8c6f292012-03-09 13:37:40 +010052
53exit $ret