tests/Makefile: call sub-makes with SKIP_DOCKER_BUILD=1
authorAlex Bennée <alex.bennee@linaro.org>
Fri, 15 Jun 2018 18:20:55 +0000 (19:20 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 20 Jun 2018 21:13:39 +0000 (22:13 +0100)
As we now ensure all the images we are going to use are built in the
top level make file lets not over complicate things by running the
full script again. We do run the check script just in case someone
deletes the docker image while we are running.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
tests/Makefile.include
tests/docker/Makefile.include

index da647324a20c3ead453914c8be0edcd5531ad2bc..7c48cfe14e0a12ccd139aa558eb748e901e5eea9 100644 (file)
@@ -947,10 +947,14 @@ $(foreach PROBE_TARGET,$(TARGET_LIST),                            \
 endif
 
 build-tcg-tests-%:
-       $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" guest-tests,)
+       $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" \
+               SKIP_DOCKER_BUILD=1 TARGET_DIR="$*/" guest-tests, \
+               "BUILD", "TCG tests for $*")
 
 run-tcg-tests-%: % build-tcg-tests-%
-       $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" run-guest-tests,)
+       $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" \
+               SKIP_DOCKER_BUILD=1 TARGET_DIR="$*/" run-guest-tests, \
+               "RUN", "TCG tests for $*")
 
 clean-tcg-tests-%:
        $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" clean-guest-tests,)
index 87f449264fdccd731c3a18aa215a89f314932b36..c0f09505bb619c88514c41f338fb6100feaa5dee 100644 (file)
@@ -34,7 +34,15 @@ docker-qemu-src: $(DOCKER_SRC_COPY)
 
 docker-image: ${DOCKER_TARGETS}
 
-# General rule for building docker images
+# General rule for building docker images. If we are a sub-make
+# invoked with SKIP_DOCKER_BUILD we still check the image is upto date
+# though
+ifdef SKIP_DOCKER_BUILD
+docker-image-%: $(DOCKER_FILES_DIR)/%.docker
+       $(call quiet-command, \
+               $(DOCKER_SCRIPT) check --quiet qemu:$* $<, \
+               "CHECK", "$*")
+else
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
        @if test "$@" = docker-image-debian-bootstrap -a -z "$(EXECUTABLE)"; then \
                echo WARNING: EXECUTABLE is not set, debootstrap may fail. 2>&1 ; \
@@ -46,6 +54,7 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker
                $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\
                $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\
                "BUILD","$*")
+endif
 
 # Enforce dependencies for composite images
 docker-image-debian: docker-image-debian9
@@ -65,7 +74,9 @@ docker-image-debian-win64-cross: docker-image-debian8-mxe
 # Debian SID images - we are tracking a rolling distro so we want to
 # force a re-build of the base image if we ever need to build one of
 # its children.
+ifndef SKIP_DOCKER_BUILD
 docker-image-debian-sid: NOCACHE=1
+endif
 
 docker-image-debian-alpha-cross: docker-image-debian-sid
 docker-image-debian-hppa-cross: docker-image-debian-sid