Skip to content

Commit a0ea09c

Browse files
committed
backport 07f550b
1 parent e6ee2ae commit a0ea09c

11 files changed

Lines changed: 251 additions & 20 deletions

File tree

make/Global.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ help:
103103
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
104104
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
105105
$(info $(_) # make test TEST="jdk_lang gtest:all")
106+
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk)
106107
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'help' to list)
107108
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'help' to list)
108109
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'help' to list)

make/InitSupport.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ifeq ($(HAS_SPEC),)
5050

5151
# Make control variables, handled by Init.gmk
5252
INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
53-
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS
53+
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
5454

5555
# All known make control variables
5656
MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER SPEC_FILTER

make/Main.gmk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -774,13 +774,13 @@ $(eval $(call SetupTarget, build-microbenchmark, \
774774
$(eval $(call SetupTarget, test, \
775775
MAKEFILE := RunTests, \
776776
ARGS := TEST="$(TEST)", \
777-
DEPS := jdk-image test-image, \
777+
DEPS := jdk-image test-image $(TEST_DEPS), \
778778
))
779779

780780
$(eval $(call SetupTarget, exploded-test, \
781781
MAKEFILE := RunTests, \
782782
ARGS := TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR), \
783-
DEPS := exploded-image test-image, \
783+
DEPS := exploded-image test-image $(TEST_DEPS), \
784784
))
785785

786786
ifeq ($(JCOV_ENABLED), true)
@@ -1061,8 +1061,8 @@ else
10611061
test-make-compile-commands: compile-commands
10621062

10631063
# Declare dependency for all generated test targets
1064-
$(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image))
1065-
$(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image))
1064+
$(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image $(TEST_DEPS)))
1065+
$(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image $(TEST_DEPS)))
10661066

10671067
interim-image: $(INTERIM_JMOD_TARGETS)
10681068

make/RunTests.gmk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt
263263
langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt
264264
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
265265
lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt
266+
docs_JTREG_PROBLEM_LIST += $(TOPDIR)/test/docs/ProblemList.txt
266267

267268
################################################################################
268269
# Parse test selection
@@ -866,6 +867,8 @@ define SetupRunJtregTestBody
866867

867868
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_DIR=$(TEST_IMAGE_DIR)
868869

870+
$1_JTREG_BASIC_OPTIONS += -e:DOCS_JDK_IMAGE_DIR=$$(DOCS_JDK_IMAGE_DIR)
871+
869872
ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), )
870873
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
871874
endif

make/common/FindTests.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, common/FindTests.gmk))
4343
TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)
4444

4545
# JTREG_TESTROOTS might have been set by a custom extension
46-
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test)
46+
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test docs)
4747

4848
# Extract the names of the Jtreg group files from the TEST.ROOT files. The
4949
# TEST.ROOT files being properties files can be interpreted as makefiles so

make/conf/jib-profiles.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ var getJibProfilesProfiles = function (input, common, data) {
952952

953953
// Profiles used to run tests using Jib for internal dependencies.
954954
var testedProfile = input.testedProfile;
955-
if (testedProfile == null) {
955+
if (testedProfile == null || testedProfile == "docs") {
956956
testedProfile = input.build_os + "-" + input.build_cpu;
957957
}
958958
var testedProfileJdk = testedProfile + ".jdk";
@@ -994,25 +994,38 @@ var getJibProfilesProfiles = function (input, common, data) {
994994
testOnlyProfilesPrebuilt["run-test-prebuilt"]["dependencies"].push(testedProfile + ".jdk_symbols");
995995
}
996996

997+
var testOnlyProfilesPrebuiltDocs = {
998+
"run-test-prebuilt-docs": clone(testOnlyProfilesPrebuilt["run-test-prebuilt"])
999+
};
1000+
1001+
testOnlyProfilesPrebuiltDocs["run-test-prebuilt-docs"].dependencies.push("docs.doc_api_spec", "tidy");
1002+
testOnlyProfilesPrebuiltDocs["run-test-prebuilt-docs"].environment["DOCS_JDK_IMAGE_DIR"]
1003+
= input.get("docs.doc_api_spec", "install_path");
1004+
testOnlyProfilesPrebuiltDocs["run-test-prebuilt-docs"].environment["TIDY"]
1005+
= input.get("tidy", "home_path") + "/bin/tidy";
1006+
testOnlyProfilesPrebuiltDocs["run-test-prebuilt-docs"].labels = "test-docs";
1007+
9971008
// If actually running the run-test-prebuilt profile, verify that the input
9981009
// variable is valid and if so, add the appropriate target_* values from
9991010
// the tested profile. Use testImageProfile value as backup.
1000-
if (input.profile == "run-test-prebuilt") {
1011+
if (input.profile == "run-test-prebuilt" || input.profile == "run-test-prebuilt-docs") {
10011012
if (profiles[testedProfile] == null && profiles[testImageProfile] == null) {
10021013
error("testedProfile is not defined: " + testedProfile + " " + testImageProfile);
10031014
}
10041015
}
1005-
if (profiles[testedProfile] != null) {
1006-
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
1007-
= profiles[testedProfile]["target_os"];
1008-
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
1009-
= profiles[testedProfile]["target_cpu"];
1010-
} else if (profiles[testImageProfile] != null) {
1011-
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
1012-
= profiles[testImageProfile]["target_os"];
1013-
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
1014-
= profiles[testImageProfile]["target_cpu"];
1016+
function updateProfileTargets(profiles, testedProfile, testImageProfile, targetProfile, runTestProfile) {
1017+
var profileToCheck = profiles[testedProfile] || profiles[testImageProfile];
1018+
1019+
if (profileToCheck != null) {
1020+
targetProfile[runTestProfile]["target_os"] = profileToCheck["target_os"];
1021+
targetProfile[runTestProfile]["target_cpu"] = profileToCheck["target_cpu"];
1022+
}
10151023
}
1024+
1025+
updateProfileTargets(profiles, testedProfile, testImageProfile, testOnlyProfilesPrebuilt, "run-test-prebuilt");
1026+
updateProfileTargets(profiles, testedProfile, testImageProfile, testOnlyProfilesPrebuiltDocs, "run-test-prebuilt-docs");
1027+
1028+
profiles = concatObjects(profiles, testOnlyProfilesPrebuiltDocs);
10161029
profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
10171030

10181031
// On macosx add the devkit bin dir to the path in all the run-test profiles.
@@ -1062,6 +1075,8 @@ var getJibProfilesProfiles = function (input, common, data) {
10621075
}
10631076
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
10641077
runTestPrebuiltSrcFullExtra);
1078+
profiles["run-test-prebuilt-docs"] = concatObjects(profiles["run-test-prebuilt-docs"],
1079+
runTestPrebuiltSrcFullExtra);
10651080
}
10661081

10671082
// Generate the missing platform attributes

test/docs/ProblemList.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
###########################################################################
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
#
6+
# This code is free software; you can redistribute it and/or modify it
7+
# under the terms of the GNU General Public License version 2 only, as
8+
# published by the Free Software Foundation.
9+
#
10+
# This code is distributed in the hope that it will be useful, but WITHOUT
11+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
# version 2 for more details (a copy is included in the LICENSE file that
14+
# accompanied this code).
15+
#
16+
# You should have received a copy of the GNU General Public License version
17+
# 2 along with this work; if not, write to the Free Software Foundation,
18+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
#
20+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21+
# or visit www.oracle.com if you need additional information or have any
22+
# questions.
23+
#
24+
###########################################################################
25+
26+
#############################################################################
27+
#
28+
# List of quarantined tests -- tests that should not be run by default, because
29+
# they may fail due to known reason. The reason (CR#) must be mandatory specified.
30+
#
31+
# List items are testnames followed by labels, all MUST BE commented
32+
# as to why they are here and use a label:
33+
# generic-all Problems on all platforms
34+
# generic-ARCH Where ARCH is one of: x64, i586, ppc64, ppc64le, s390x etc.
35+
# OSNAME-all Where OSNAME is one of: linux, windows, macosx, aix
36+
# OSNAME-ARCH Specific on to one OSNAME and ARCH, e.g. macosx-x64
37+
# OSNAME-REV Specific on to one OSNAME and REV, e.g. macosx-10.7.4
38+
#
39+
# More than one label is allowed but must be on the same line.
40+
#
41+
#############################################################################

test/docs/TEST.ROOT

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation.
8+
#
9+
# This code is distributed in the hope that it will be useful, but WITHOUT
10+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
# version 2 for more details (a copy is included in the LICENSE file that
13+
# accompanied this code).
14+
#
15+
# You should have received a copy of the GNU General Public License version
16+
# 2 along with this work; if not, write to the Free Software Foundation,
17+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
#
19+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
# or visit www.oracle.com if you need additional information or have any
21+
# questions.
22+
#
23+
24+
#
25+
26+
# This file identifies the root of the test-suite hierarchy.
27+
# It also contains test-suite configuration information.
28+
29+
# The list of keywords supported in the entire test suite. The
30+
# "intermittent" keyword marks tests known to fail intermittently.
31+
# The "randomness" keyword marks tests using randomness with test
32+
# cases differing from run to run. (A test using a fixed random seed
33+
# would not count as "randomness" by this definition.) Extra care
34+
# should be taken to handle test failures of intermittent or
35+
# randomness tests.
36+
37+
# Group definitions
38+
groups=TEST.groups
39+
40+
# Minimum jtreg version
41+
requiredVersion=7.4+1
42+
43+
# Use new module options
44+
useNewOptions=true
45+
46+
# Use --patch-module instead of -Xmodule:
47+
useNewPatchModule=true
48+
49+
# Path to libraries in the topmost test directory. This is needed so @library
50+
# does not need ../../ notation to reach them
51+
external.lib.roots = ../../

test/docs/TEST.groups

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3+
#
4+
# This code is free software; you can redistribute it and/or modify it
5+
# under the terms of the GNU General Public License version 2 only, as
6+
# published by the Free Software Foundation.
7+
#
8+
# This code is distributed in the hope that it will be useful, but WITHOUT
9+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11+
# version 2 for more details (a copy is included in the LICENSE file that
12+
# accompanied this code).
13+
#
14+
# You should have received a copy of the GNU General Public License version
15+
# 2 along with this work; if not, write to the Free Software Foundation,
16+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17+
#
18+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19+
# or visit www.oracle.com if you need additional information or have any
20+
# questions.
21+
#
22+
23+
# Docs-specific test groups
24+
25+
docs_all = \
26+
/
27+
28+
tier2 = \
29+
:docs_all
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/*
25+
* @test
26+
* @library /test/lib ../../tools/tester
27+
* @build jtreg.SkippedException
28+
* @summary example of a test on the generated documentation
29+
* @run main TestDocs
30+
*/
31+
32+
import java.nio.file.Files;
33+
34+
public class TestDocs {
35+
public static void main(String... args) throws Exception {
36+
var docs = DocTester.resolveDocs();
37+
System.err.println("Path to the docs is: " + docs);
38+
System.err.println("Do docs exits?");
39+
System.err.println(Files.exists(docs));
40+
System.err.println("tidy location");
41+
System.err.println(System.getProperty("tidy"));
42+
System.err.println("End of test");
43+
}
44+
}

0 commit comments

Comments
 (0)