mirror of
https://github.com/openjdk/jdk8u.git
synced 2025-12-10 00:09:35 -06:00
8222737: [TESTBUG] Allow for tier 1 like testing in OpenJDK 8u
Reviewed-by: shade, adinn, andrew
This commit is contained in:
parent
1dcbaba49b
commit
f1e6b1ab83
4
Makefile
4
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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
################################################################
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user