summary refs log tree commit diff stats
path: root/tests/docker
diff options
context:
space:
mode:
Diffstat (limited to 'tests/docker')
-rw-r--r--tests/docker/Makefile.include7
-rw-r--r--tests/docker/dockerfiles/debian-xtensa-cross.docker31
-rw-r--r--tests/docker/dockerfiles/fedora-cris-cross.docker8
-rwxr-xr-xtests/docker/travis1
-rwxr-xr-xtests/docker/travis.py11
5 files changed, 49 insertions, 9 deletions
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 83d43c50e4..c0e1bf57a3 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -116,6 +116,7 @@ docker-image-tricore-cross: docker-image-debian9
 DOCKER_PARTIAL_IMAGES += debian-alpha-cross debian-hppa-cross debian-m68k-cross debian-sh4-cross
 DOCKER_PARTIAL_IMAGES += debian-sparc64-cross debian-mips64-cross debian-riscv64-cross
 DOCKER_PARTIAL_IMAGES += debian-tricore-cross debian-powerpc-cross fedora-i386-cross
+DOCKER_PARTIAL_IMAGES += fedora-cris-cross
 
 # Rules for building linux-user powered images
 #
@@ -150,15 +151,15 @@ docker:
 	@echo
 	@echo '    docker:              Print this help.'
 	@echo '    docker-all-tests:    Run all image/test combinations.'
-	@echo '    docker-TEST:         Run TEST on all image combinations.'
+	@echo '    docker-TEST:         Run "TEST" on all image combinations.'
 	@echo '    docker-clean:        Kill and remove residual docker testing containers.'
 	@echo '    docker-TEST@IMAGE:   Run "TEST" in container "IMAGE".'
 	@echo '                         Note: "TEST" is one of the listed test name,'
 	@echo '                         or a script name under $$QEMU_SRC/tests/docker/;'
-	@echo '                         "IMAGE" is one of the listed container name."'
+	@echo '                         "IMAGE" is one of the listed container name.'
 	@echo '    docker-image:        Build all images.'
 	@echo '    docker-image-IMAGE:  Build image "IMAGE".'
-	@echo '    docker-run:          For manually running a "TEST" with "IMAGE"'
+	@echo '    docker-run:          For manually running a "TEST" with "IMAGE".'
 	@echo
 	@echo 'Available container images:'
 	@echo '    $(DOCKER_IMAGES)'
diff --git a/tests/docker/dockerfiles/debian-xtensa-cross.docker b/tests/docker/dockerfiles/debian-xtensa-cross.docker
new file mode 100644
index 0000000000..afd2ab9163
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-xtensa-cross.docker
@@ -0,0 +1,31 @@
+#
+# Docker cross-compiler target
+#
+# This docker target builds on the debian stretch base image,
+# using a prebuilt toolchains for Xtensa cores from:
+# https://github.com/foss-xtensa/toolchain/releases
+#
+FROM debian:stretch-slim
+
+RUN apt-get update && \
+    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt-get install -y --no-install-recommends \
+        bison \
+        build-essential \
+        ca-certificates \
+        curl \
+        flex \
+        gettext \
+        git \
+        python-minimal
+
+ENV CPU_LIST csp dc232b dc233c
+ENV TOOLCHAIN_RELEASE 2018.02
+
+RUN for cpu in $CPU_LIST; do \
+        curl -#SL http://github.com/foss-xtensa/toolchain/releases/download/$TOOLCHAIN_RELEASE/x86_64-$TOOLCHAIN_RELEASE-xtensa-$cpu-elf.tar.gz \
+        | tar -xzC /opt; \
+    done
+
+ENV PATH $PATH:/opt/$TOOLCHAIN_RELEASE/xtensa-dc232b-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dc233c-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-csp-elf/bin
diff --git a/tests/docker/dockerfiles/fedora-cris-cross.docker b/tests/docker/dockerfiles/fedora-cris-cross.docker
new file mode 100644
index 0000000000..b168ada615
--- /dev/null
+++ b/tests/docker/dockerfiles/fedora-cris-cross.docker
@@ -0,0 +1,8 @@
+#
+# Cross compiler for cris system tests
+#
+
+FROM fedora:latest
+ENV PACKAGES gcc-cris-linux-gnu
+RUN dnf install -y $PACKAGES
+RUN rpm -q $PACKAGES | sort > /packages.txt
diff --git a/tests/docker/travis b/tests/docker/travis
index d345393ced..47c03677d6 100755
--- a/tests/docker/travis
+++ b/tests/docker/travis
@@ -18,4 +18,5 @@ cmdfile=/tmp/travis_cmd_list.sh
 $QEMU_SRC/tests/docker/travis.py $QEMU_SRC/.travis.yml > $cmdfile
 chmod +x $cmdfile
 cd "$QEMU_SRC"
+unset BUILD_DIR SRC_DIR
 $cmdfile
diff --git a/tests/docker/travis.py b/tests/docker/travis.py
index ea1ef169e6..e1433012bd 100755
--- a/tests/docker/travis.py
+++ b/tests/docker/travis.py
@@ -17,18 +17,17 @@ import yaml
 import itertools
 
 def load_yaml(fname):
-    return yaml.load(open(fname, "r").read())
+    return yaml.safe_load(open(fname, "r").read())
 
 def conf_iter(conf):
+    # If "compiler" is omitted from the included env then Travis picks the
+    # first entry of the global compiler list.
+    default_compiler = conf["compiler"][0]
     def env_to_list(env):
         return env if isinstance(env, list) else [env]
     for entry in conf["matrix"]["include"]:
         yield {"env": env_to_list(entry["env"]),
-               "compiler": entry["compiler"]}
-    for entry in itertools.product(conf["compiler"],
-                                   conf["env"]["matrix"]):
-        yield {"env": env_to_list(entry[1]),
-               "compiler": entry[0]}
+               "compiler": entry.get("compiler", default_compiler)}
 
 def main():
     if len(sys.argv) < 2: