virtio-gpu: fix crashes upon warm reboot with vga mode
[qemu/ar7.git] / tests / docker / common.rc
blob4011561587a5794021187d4792360d17bfb7784c
1 #!/bin/sh
3 # Common routines for docker test scripts.
5 # Copyright (c) 2016 Red Hat Inc.
7 # Authors:
8 # Fam Zheng <famz@redhat.com>
10 # This work is licensed under the terms of the GNU GPL, version 2
11 # or (at your option) any later version. See the COPYING file in
12 # the top-level directory.
14 requires()
16 for c in $@; do
17 if ! echo "$FEATURES" | grep -wq -e "$c"; then
18 echo "Prerequisite '$c' not present, skip"
19 exit 0
21 done
24 configure_qemu()
26 config_opts="--enable-werror \
27 ${TARGET_LIST:+--target-list=${TARGET_LIST}} \
28 --prefix=$INSTALL_DIR \
29 $QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS \
30 $@"
31 echo "Configure options:"
32 echo $config_opts
33 $QEMU_SRC/configure $config_opts || \
34 { cat config.log && test_fail "Failed to run 'configure'"; }
37 build_qemu()
39 configure_qemu $@
40 make $MAKEFLAGS
43 check_qemu()
45 # default to make check unless the caller specifies
46 if test -z "$@"; then
47 INVOCATION="check"
48 else
49 INVOCATION="$@"
52 if command -v gtester > /dev/null 2>&1 && \
53 gtester --version > /dev/null 2>&1; then
54 make $MAKEFLAGS $INVOCATION
55 else
56 echo "No working gtester, skipping make $INVOCATION"
60 test_fail()
62 echo "$@"
63 exit 1
66 prep_fail()
68 echo "$@"
69 exit 2
72 install_qemu()
74 make install $MAKEFLAGS DESTDIR=$PWD/=destdir
75 ret=$?
76 rm -rf $PWD/=destdir
77 return $ret