--- old/make/Main.gmk 2019-05-20 20:40:33.430954988 +0200 +++ new/make/Main.gmk 2019-05-20 20:40:33.181954616 +0200 @@ -172,11 +172,17 @@ @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image @($(CD) $(SRC_ROOT) && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images) +# If the tests produced a $(TEST)_exitcode.txt file, use the number in that +# file for the exit code of the "make test" invocation. test: images test-only test-only: start-make @$(call TargetEnter) @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true @$(call TargetExit) + @(if [ -r $(OUTPUT_ROOT)/testoutput/$(TEST)_exitcode.txt ]; then \ + EXIT=$$($(CAT) $(OUTPUT_ROOT)/testoutput/$(TEST)_exitcode.txt); \ + exit $${EXIT}; \ + fi) # Stores the tips for each repository. This file is be used when constructing the jdk image and can be # used to track the exact sources used to build that image.