diff -r 320af913b4de -r daa47f8cf745 make/Main.gmk --- a/make/Main.gmk Sat Nov 09 20:15:27 2019 +0800 +++ b/make/Main.gmk Sat Nov 09 20:29:44 2019 +0800 @@ -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.