aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgehwolf <unknown>2019-04-25 14:01:57 +0200
committerbell-sw <liberica@bell-sw.com>2019-10-23 16:22:15 +0300
commita5dcaa3947c587042b6c8ab64b10fdc9ad753a15 (patch)
tree61aea23e9feb31d9f05fdd8beb690f7c7c788061
parent99f10094ae22e5e19f3524c09690c4337b74f760 (diff)
downloadjdk8u-a5dcaa3947c587042b6c8ab64b10fdc9ad753a15.tar.gz
8222737: [TESTBUG] Allow for tier 1 like testing in OpenJDK 8u
Reviewed-by: shade, adinn, andrew
-rw-r--r--Makefile4
-rw-r--r--make/Main.gmk6
-rw-r--r--test/Makefile49
3 files changed, 56 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 7fe922b..d1ca32b 100644
--- a/Makefile
+++ b/Makefile
@@ -101,7 +101,7 @@ help:
$(info . # generated by configure)
$(info . make dist-clean # Remove all files, including configuration)
$(info . make help # Give some help on using make)
- $(info . make test # Run tests, default is all tests (see TEST below))
+ $(info . make test # Run tests, default is "jdk_core langtools_jtreg" (see TEST below))
$(info )
$(info Targets for specific components)
$(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, nashorn, images, overlay-images, docs or test))
@@ -125,6 +125,8 @@ help:
$(info )
$(info . make test TEST=<test> # Only run the given test or tests, e.g.)
$(info . # make test TEST="jdk_lang jdk_net")
+ $(info . # or)
+ $(info . # make test TEST="tier1")
$(info )
.PHONY: help
diff --git a/make/Main.gmk b/make/Main.gmk
index 476a473..7d7a5e5 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -172,11 +172,17 @@ bootcycle-images-only: start-make
@$(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.
diff --git a/test/Makefile b/test/Makefile
index 89141cc..28ecdbb 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -50,6 +50,22 @@ else \
fi
endef
+# Macro to print a summary for a given test subdirectory
+define SUBDIR_SUMMARY # subdirectory to print summary
+if [ -d $1 ] ; then \
+ if [ -r $1/Stats.txt ] ; then \
+ cat $1/Stats.txt; \
+ echo ""; \
+ else \
+ echo "ERROR: File does not exist: $1/Stats.txt"; \
+ exit 1; \
+ fi; \
+else \
+ echo "WARNING: Expected directory does not exist: $1"; \
+ echo " Test summary might be incorrect."; \
+fi
+endef
+
# Default test target (core)
default: jdk_core langtools_jtreg
@@ -58,7 +74,7 @@ all: jdk_all langtools_all
# Test targets
langtools_% :
- @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
+ @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) UNIQUE_DIR="$@" TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
jdk_% core_%s svc_%:
@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@)
@@ -66,6 +82,35 @@ jdk_% core_%s svc_%:
hotspot_%:
@$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@)
+# Variables for tier1 testing
+TIER1_TESTOUTPUT="$(ALT_OUTPUTDIR)/testoutput"
+TIER1_STATUS_FILE="$(TIER1_TESTOUTPUT)/tier1_exitcode.txt"
+
+# Note: Test failures are handled via summary_tier1 as the
+# tier1 targets are never aborted even if tests fail.
+tier1: prep_tier1 jdk_tier1 langtools_tier1 hotspot_tier1 summary_tier1
+
+prep_tier1:
+ @rm -rf $(TIER1_STATUS_FILE)
+
+# This relies on jdk_tier1, langtools_tier1, hotspot_tier1 producing
+# Stats.txt (summary) and exitcode.txt files.
+summary_tier1:
+ @(EXIT_VAL=0; \
+ echo ""; \
+ echo "-------------- Test Summary ------------"; \
+ echo ""; \
+ for test_dir in $$(find "$(ALT_OUTPUTDIR)" -type d -name \*_tier1); do \
+ $(call SUBDIR_SUMMARY, $${test_dir}); \
+ EXIT_VAL=$$(expr $${EXIT_VAL} + $$(cat $${test_dir}/exitcode.txt)); \
+ done; \
+ echo $${EXIT_VAL} > $(TIER1_STATUS_FILE); \
+ echo "For details see:"; \
+ echo $(TIER1_TESTOUTPUT); \
+ echo ""; \
+ echo "-------------- Test Summary ------------"; \
+ echo "")
+
#
# jtreg_tests
#
@@ -95,6 +140,6 @@ jtreg_tests:
################################################################
# Phony targets (e.g. these are not filenames)
-.PHONY: all clean
+.PHONY: all clean summary_tier1 prep_tier1
################################################################