summaryrefslogtreecommitdiff
path: root/tests/docker/common.rc
blob: 0c6d8d5ecea61229aa40c9d431ec8300aade96d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# Common routines for docker test scripts.
#
# Copyright (c) 2016 Red Hat Inc.
#
# Authors:
#  Fam Zheng <famz@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2
# or (at your option) any later version. See the COPYING file in
# the top-level directory.

requires()
{
    for c in $@; do
        if ! echo "$FEATURES" | grep -wq -e "$c"; then
            echo "Prerequisite '$c' not present, skip"
            exit 0
        fi
    done
}

build_qemu()
{
    $QEMU_SRC/configure \
        --enable-werror \
        ${TARGET_LIST:+"--target-list=${TARGET_LIST}"} \
        --prefix="$PWD/install" \
        $EXTRA_CONFIGURE_OPTS \
        "$@"
    make $MAKEFLAGS
}