target-arm: Add support for PMU register PMSELR_EL0
[qemu/ar7.git] / tests / docker / run
blobc1e4513bcee04753546a05ce57b64df0759f22cb
1 #!/bin/bash -e
3 # Docker test runner
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 set -e
16 if test -n "$V"; then
17 set -x
20 BASE="$(dirname $(readlink -e $0))"
22 # Prepare the environment
23 . /etc/profile || true
24 export PATH=/usr/lib/ccache:$PATH
26 if test -n "$J"; then
27 export MAKEFLAGS="$MAKEFLAGS -j$J"
30 # We are in the container so the whole file system belong to us
31 export TEST_DIR=/tmp/qemu-test
32 mkdir -p $TEST_DIR/{src,build,install}
34 # Extract the source tarballs
35 tar -C $TEST_DIR/src -xzf $BASE/qemu.tgz
36 for p in dtc pixman; do
37 if test -f $BASE/$p.tgz; then
38 tar -C $TEST_DIR/src/$p -xzf $BASE/$p.tgz
39 export FEATURES="$FEATURES $p"
41 done
43 if test -n "$SHOW_ENV"; then
44 if test -f /packages.txt; then
45 echo "Packages installed:"
46 cat /packages.txt
47 echo
49 echo "Environment variables:"
50 env
51 echo
54 export QEMU_SRC="$TEST_DIR/src"
56 cd "$QEMU_SRC/tests/docker"
58 CMD="$QEMU_SRC/tests/docker/$@"
60 if test -z "$DEBUG"; then
61 exec $CMD
64 # DEBUG workflow
65 echo "* Prepared to run command:"
66 echo " $CMD"
67 echo "* Hit Ctrl-D to continue, or type 'exit 1' to abort"
68 echo
69 $SHELL
71 if "$CMD"; then
72 exit 0
73 elif test -n "$DEBUG"; then
74 echo "* Command failed:"
75 echo " $CMD"
76 echo "* Hit Ctrl-D to exit"
77 echo
78 # Force error after shell exits
79 $SHELL && exit 1
80 else
81 exit 1