From 79f9ab423571c585e2716d06894a94bd36299d44 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 29 May 2017 14:06:24 +0200 Subject: [PATCH] 8180651: Make target to run tests on exploded image Reviewed-by: ihse --- common/doc/testing.html | 4 +++- common/doc/testing.md | 6 ++++++ make/Help.gmk | 2 ++ make/Main.gmk | 15 +++++++++++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/common/doc/testing.html b/common/doc/testing.html index 265be8b9e8a..1b782f07eae 100644 --- a/common/doc/testing.html +++ b/common/doc/testing.html @@ -29,13 +29,15 @@

Using the run-test framework

This new way of running tests is developer-centric. It assumes that you have built a jdk locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.

+

The main target "run-test" uses the jdk-image as the tested product. There is also an alternate target "exploded-run-test" that uses the exploded image instead. Not all tests will run successfully on the exploded image, but using this target can greatly improve rebuild times for certain workflows.

Some example command-lines:

$ make run-test-tier1
 $ make run-test-jdk_lang JTREG="JOBS=8"
 $ make run-test TEST=jdk_lang
 $ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
 $ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"
-$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
+$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java" +$ make exploded-run-test TEST=hotspot_tier1

Test selection

All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the TEST variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.

For some common top-level tests, direct make targets have been generated. This includes all JTreg test groups, the hotspot gtest, and custom tests (if present). This means that make run-test-tier1 is equivalent to make run-test TEST="tier1", but the latter is more tab-completion friendly. For more complex test runs, the run-test TEST="x" solution needs to be used.

diff --git a/common/doc/testing.md b/common/doc/testing.md index f84bd27dda2..231755c92b1 100644 --- a/common/doc/testing.md +++ b/common/doc/testing.md @@ -7,6 +7,11 @@ built a jdk locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve. +The main target "run-test" uses the jdk-image as the tested product. There is +also an alternate target "exploded-run-test" that uses the exploded image +instead. Not all tests will run successfully on the exploded image, but using +this target can greatly improve rebuild times for certain workflows. + Some example command-lines: $ make run-test-tier1 @@ -15,6 +20,7 @@ Some example command-lines: $ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1" $ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug" $ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java" + $ make exploded-run-test TEST=hotspot_tier1 ## Test selection diff --git a/make/Help.gmk b/make/Help.gmk index c9a06d291af..4514eb08b8d 100644 --- a/make/Help.gmk +++ b/make/Help.gmk @@ -56,6 +56,8 @@ help: $(info $(_) make test # Run tests, default is all tests (see TEST below)) $(info $(_) make run-test- # Run test, e.g. run-test-tier1) $(info $(_) make run-test TEST= # Run test(s) given by TEST specification) + $(info $(_) make exploded-run-test TEST= # Run test(s) on the exploded image instead of) + $(info $(_) # the full jdk image) $(info ) $(info Targets for cleaning) $(info $(_) make clean # Remove all files generated by make, but not those) diff --git a/make/Main.gmk b/make/Main.gmk index ab6eb7d2e2b..7d85c1b062a 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -450,13 +450,18 @@ define DeclareRunTestRecipe run-test-$1: +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1") + exploded-run-test-$1: + +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ + TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) + endef # ALL_NAMED_TESTS is defined in FindTests.gmk $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t))) ALL_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS)) +ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-run-test-, $(ALL_NAMED_TESTS)) -ALL_TARGETS += $(ALL_TEST_TARGETS) +ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS) ################################################################################ # Build tests @@ -485,6 +490,10 @@ test-image-jdk-jtreg-native: run-test: +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)") +exploded-run-test: + +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ + TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) + ifeq ($(BUILD_GTEST), true) test-image-hotspot-gtest: +($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk) @@ -514,7 +523,7 @@ ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \ test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \ test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \ test-failure-handler test-image-failure-handler test-image-hotspot-gtest \ - run-test + run-test exploded-run-test ################################################################################ # Run tests @@ -807,9 +816,11 @@ else test: jdk-image test-image run-test: jdk-image test-image + exploded-run-test: exploded-image test-image # Declare dependency for all generated test targets $(foreach t, $(ALL_TEST_TARGETS), $(eval $t: jdk-image test-image)) + $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image)) create-buildjdk-copy: jdk.jlink-java java.base-gendata \ $(addsuffix -java, $(INTERIM_IMAGE_MODULES))