Skip to content

Commit f0b476a

Browse files
committed
Merge
2 parents 01ec1f2 + dfc5c79 commit f0b476a

File tree

967 files changed

+12511
-8732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

967 files changed

+12511
-8732
lines changed

doc/testing.html

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="generator" content="pandoc" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
77
<title>Testing the JDK</title>
8-
<style type="text/css">
8+
<style>
99
code{white-space: pre-wrap;}
1010
span.smallcaps{font-variant: small-caps;}
1111
span.underline{text-decoration: underline;}
@@ -21,9 +21,9 @@
2121
<header id="title-block-header">
2222
<h1 class="title">Testing the JDK</h1>
2323
</header>
24-
<nav id="TOC">
24+
<nav id="TOC" role="doc-toc">
2525
<ul>
26-
<li><a href="#using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</a><ul>
26+
<li><a href="#using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</a><ul>
2727
<li><a href="#configuration">Configuration</a></li>
2828
</ul></li>
2929
<li><a href="#test-selection">Test selection</a><ul>
@@ -42,10 +42,11 @@ <h1 class="title">Testing the JDK</h1>
4242
<li><a href="#notes-for-specific-tests">Notes for Specific Tests</a><ul>
4343
<li><a href="#docker-tests">Docker Tests</a></li>
4444
<li><a href="#non-us-locale">Non-US locale</a></li>
45+
<li><a href="#pkcs11-tests">PKCS11 Tests</a></li>
4546
</ul></li>
4647
</ul>
4748
</nav>
48-
<h2 id="using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</h2>
49+
<h2 id="using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</h2>
4950
<p>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.</p>
5051
<p>The main target <code>test</code> uses the jdk-image as the tested product. There is also an alternate target <code>exploded-test</code> 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.</p>
5152
<p>Previously, <code>make test</code> was used to invoke an old system for running tests, and <code>make run-test</code> was used for the new test framework. For backward compatibility with scripts and muscle memory, <code>run-test</code> (and variants like <code>exploded-run-test</code> or <code>run-test-tier1</code>) are kept as aliases.</p>
@@ -63,7 +64,7 @@ <h3 id="configuration">Configuration</h3>
6364
<p>To be able to run microbenchmarks, <code>configure</code> needs to know where to find the JMH dependency. Use <code>--with-jmh=&lt;path to JMH jars&gt;</code> to point to a directory containing the core JMH and transitive dependencies. The recommended dependencies can be retrieved by running <code>sh make/devkit/createJMHBundle.sh</code>, after which <code>--with-jmh=build/jmh/jars</code> should work.</p>
6465
<h2 id="test-selection">Test selection</h2>
6566
<p>All functionality is available using the <code>test</code> make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, <code>test-only</code> can be used instead, which do not depend on the source and test image build.</p>
66-
<p>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 <code>make test-tier1</code> is equivalent to <code>make test TEST=&quot;tier1&quot;</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST=&quot;x&quot;</code> solution needs to be used.</p>
67+
<p>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 <code>make test-tier1</code> is equivalent to <code>make test TEST="tier1"</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST="x"</code> solution needs to be used.</p>
6768
<p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
6869
<h3 id="jtreg">JTReg</h3>
6970
<p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
@@ -103,8 +104,8 @@ <h2 id="test-results-and-summary">Test results and summary</h2>
103104
<p>Additional work data is stored in <code>build/$BUILD/test-support/$TEST_ID</code>. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.</p>
104105
<h2 id="test-suite-control">Test suite control</h2>
105106
<p>It is possible to control various aspects of the test suites using make control variables.</p>
106-
<p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG=&quot;JOBS=1;TIMEOUT_FACTOR=8&quot;</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG=&quot;TMIEOUT_FACTOR=8&quot;</code> would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would just pass unnoticed.</p>
107-
<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG=&quot;...;...&quot;</code>. This will also make sure spaces are preserved, as in <code>JTREG=&quot;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;</code>.</p>
107+
<p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG="JOBS=1;TIMEOUT_FACTOR=8"</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG="TMIEOUT_FACTOR=8"</code> would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would just pass unnoticed.</p>
108+
<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG="...;..."</code>. This will also make sure spaces are preserved, as in <code>JTREG="VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"</code>.</p>
108109
<p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT_FACTOR=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
109110
<p>As far as possible, the names of the keywords have been standardized between test suites.</p>
110111
<h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
@@ -159,7 +160,7 @@ <h4 id="run_problem_lists">RUN_PROBLEM_LISTS</h4>
159160
<p>Set to <code>true</code> or <code>false</code>. If <code>true</code>, JTReg will use <code>-match:</code> option, otherwise <code>-exclude:</code> will be used. Default is <code>false</code>.</p>
160161
<h4 id="options">OPTIONS</h4>
161162
<p>Additional options to the JTReg test framework.</p>
162-
<p>Use <code>JTREG=&quot;OPTIONS=--help all&quot;</code> to see all available JTReg options.</p>
163+
<p>Use <code>JTREG="OPTIONS=--help all"</code> to see all available JTReg options.</p>
163164
<h4 id="java_options-1">JAVA_OPTIONS</h4>
164165
<p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
165166
<h4 id="vm_options-1">VM_OPTIONS</h4>
@@ -172,7 +173,7 @@ <h4 id="repeat">REPEAT</h4>
172173
<p>Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with <code>OPTIONS=--gtest_break_on_failure</code> to reproduce an intermittent problem.</p>
173174
<h4 id="options-1">OPTIONS</h4>
174175
<p>Additional options to the Gtest test framework.</p>
175-
<p>Use <code>GTEST=&quot;OPTIONS=--help&quot;</code> to see all available Gtest options.</p>
176+
<p>Use <code>GTEST="OPTIONS=--help"</code> to see all available Gtest options.</p>
176177
<h4 id="aot_modules-2">AOT_MODULES</h4>
177178
<p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
178179
<h3 id="microbenchmark-keywords">Microbenchmark keywords</h3>
@@ -199,8 +200,12 @@ <h3 id="docker-tests">Docker Tests</h3>
199200
<p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
200201
<pre><code>$ make test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot; JTREG=&quot;JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest&quot;</code></pre>
201202
<h3 id="non-us-locale">Non-US locale</h3>
202-
<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG=&quot;en_US&quot;</code> in the environment before running tests should work. On Windows, setting <code>JTREG=&quot;VM_OPTIONS=-Duser.language=en -Duser.country=US&quot;</code> helps for most, but not all test cases. For example:</p>
203+
<p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases. For example:</p>
203204
<pre><code>$ export LANG=&quot;en_US&quot; &amp;&amp; make test TEST=...
204205
$ make test JTREG=&quot;VM_OPTIONS=-Duser.language=en -Duser.country=US&quot; TEST=...</code></pre>
206+
<h3 id="pkcs11-tests">PKCS11 Tests</h3>
207+
<p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories. For example:</p>
208+
<pre><code>$ make test TEST=&quot;jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java&quot; JTREG=&quot;JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs&quot;</code></pre>
209+
<p>For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.</p>
205210
</body>
206211
</html>

doc/testing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,20 @@ For example:
407407
$ export LANG="en_US" && make test TEST=...
408408
$ make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST=...
409409

410+
### PKCS11 Tests
411+
412+
It is highly recommended to use the latest NSS version when running PKCS11 tests.
413+
Improper NSS version may lead to unexpected failures which are hard to diagnose.
414+
For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu
415+
18.04 with the default NSS version in the system.
416+
To run these tests correctly, the system property `test.nss.lib.paths` is required
417+
on Ubuntu 18.04 to specify the alternative NSS lib directories.
418+
For example:
419+
420+
$ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" JTREG="JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs"
421+
422+
For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.
423+
410424
---
411425
# Override some definitions in the global css file that are not optimal for
412426
# this document.

make/Main.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,8 @@ else
707707
$(foreach m, $(JAVA_MODULES), \
708708
$(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
709709
$(call FindDepsForModule,$m)))))
710+
# Declare dependencies between the module meta targets
711+
$(foreach m, $(ALL_MODULES), $(eval $m: $(call FindDepsForModule,$m)))
710712

711713
# Declare dependencies between <module>-rmic to <module>-java
712714
$(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))

make/autoconf/basics.m4

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,32 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH],
205205
fi
206206
])
207207

208+
################################################################################
209+
# This will make a path absolute. Assumes it's already a unix path. Also
210+
# resolves ~ to homedir.
211+
AC_DEFUN([BASIC_ABSOLUTE_PATH],
212+
[
213+
if test "x[$]$1" != x; then
214+
new_path="[$]$1"
215+
216+
if [ [[ "$new_path" = ~* ]] ]; then
217+
# Use eval to expand a potential ~
218+
eval new_path="$new_path"
219+
if test ! -f "$new_path" && test ! -d "$new_path"; then
220+
AC_MSG_ERROR([The new_path of $1, which resolves as "$new_path", is not found.])
221+
fi
222+
fi
223+
224+
if test -d "$new_path"; then
225+
$1="`cd "$new_path"; $THEPWDCMD -L`"
226+
else
227+
dir="`$DIRNAME "$new_path"`"
228+
base="`$BASENAME "$new_path"`"
229+
$1="`cd "$dir"; $THEPWDCMD -L`/$base"
230+
fi
231+
fi
232+
])
233+
208234
###############################################################################
209235
# This will make sure the given variable points to a full and proper
210236
# path. This means:
@@ -217,7 +243,6 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH],
217243
AC_DEFUN([BASIC_FIXUP_PATH],
218244
[
219245
# Only process if variable expands to non-empty
220-
221246
if test "x[$]$1" != x; then
222247
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
223248
BASIC_FIXUP_PATH_CYGWIN($1)
@@ -234,19 +259,8 @@ AC_DEFUN([BASIC_FIXUP_PATH],
234259
AC_MSG_ERROR([Spaces are not allowed in this path.])
235260
fi
236261
237-
# Use eval to expand a potential ~
238-
eval path="$path"
239-
if test ! -f "$path" && test ! -d "$path"; then
240-
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
241-
fi
242-
243-
if test -d "$path"; then
244-
$1="`cd "$path"; $THEPWDCMD -L`"
245-
else
246-
dir="`$DIRNAME "$path"`"
247-
base="`$BASENAME "$path"`"
248-
$1="`cd "$dir"; $THEPWDCMD -L`/$base"
249-
fi
262+
BASIC_ABSOLUTE_PATH(path)
263+
$1="$path"
250264
fi
251265
fi
252266
])

make/autoconf/basics_windows.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ AC_DEFUN([BASIC_FIXUP_PATH_CYGWIN],
148148
path="[$]$1"
149149
new_path=`$CYGPATH -u "$path"`
150150
151+
BASIC_ABSOLUTE_PATH(new_path)
152+
151153
# Cygwin tries to hide some aspects of the Windows file system, such that binaries are
152154
# named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
153155
# the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
@@ -181,6 +183,8 @@ AC_DEFUN([BASIC_FIXUP_PATH_MSYS],
181183
new_path=`cmd //c echo $path`
182184
fi
183185
186+
BASIC_ABSOLUTE_PATH(new_path)
187+
184188
BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS([$new_path])
185189
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path)
186190
if test "x$path" != "x$new_path"; then
@@ -199,6 +203,8 @@ AC_DEFUN([BASIC_FIXUP_PATH_WSL],
199203
new_path="[$]$1"
200204
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([new_path])
201205
206+
BASIC_ABSOLUTE_PATH(new_path)
207+
202208
# Call helper function which possibly converts this using DOS-style short mode.
203209
# If so, the updated path is stored in $new_path.
204210
BASIC_MAKE_WINDOWS_SPACE_SAFE_WSL([$new_path])

make/common/TestFilesCompilation.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ define SetupTestFilesCompilationBody
6262
$1_OUTPUT_SUBDIR := lib
6363
$1_BASE_CFLAGS := $(CFLAGS_JDKLIB)
6464
$1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB)
65-
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
65+
$1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN)
6666
$1_COMPILATION_TYPE := LIBRARY
6767
else ifeq ($$($1_TYPE), PROGRAM)
6868
$1_PREFIX = exe

make/data/tzdata/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
# or visit www.oracle.com if you need additional information or have any
2222
# questions.
2323
#
24-
tzdata2019b
24+
tzdata2019c

make/data/tzdata/asia

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# tz@iana.org for general use in the future). For more, please see
3232
# the file CONTRIBUTING in the tz distribution.
3333

34-
# From Paul Eggert (2018-06-19):
34+
# From Paul Eggert (2019-07-11):
3535
#
3636
# Unless otherwise specified, the source for data through 1990 is:
3737
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -70,13 +70,13 @@
7070
# 7:00 WIB west Indonesia (Waktu Indonesia Barat)
7171
# 8:00 WITA central Indonesia (Waktu Indonesia Tengah)
7272
# 8:00 CST China
73-
# 8:00 PST PDT* Philippine Standard Time
73+
# 8:00 HKT HKST Hong Kong (HKWT* for Winter Time in late 1941)
74+
# 8:00 PST PDT* Philippines
7475
# 8:30 KST KDT Korea when at +0830
7576
# 9:00 WIT east Indonesia (Waktu Indonesia Timur)
7677
# 9:00 JST JDT Japan
7778
# 9:00 KST KDT Korea when at +09
78-
# 9:30 ACST Australian Central Standard Time
79-
# *I invented the abbreviation PDT; see "Philippines" below.
79+
# *I invented the abbreviations HKWT and PDT; see below.
8080
# Otherwise, these tables typically use numeric abbreviations like +03
8181
# and +0330 for integer hour and minute UT offsets. Although earlier
8282
# editions invented alphabetic time zone abbreviations for every
@@ -676,6 +676,15 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928
676676
# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning.
677677
# https://i.imgur.com/dge4kFJ.png
678678

679+
# From Paul Eggert (2019-07-11):
680+
# "Hong Kong winter time" is considered to be daylight saving.
681+
# "Hong Kong had adopted daylight saving on June 15 as a wartime measure,
682+
# clocks moving forward one hour until October 1, when they would be put back
683+
# by just half an hour for 'Hong Kong Winter time', so that daylight saving
684+
# operated year round." -- Low Z. The longest day: when wartime Hong Kong
685+
# introduced daylight saving. South China Morning Post. 2019-06-28.
686+
# https://www.scmp.com/magazines/post-magazine/short-reads/article/3016281/longest-day-when-wartime-hong-kong-introduced
687+
679688
# From P Chan (2018-12-31):
680689
# * According to the Hong Kong Daylight-Saving Regulations, 1941, the
681690
# 1941 spring-forward transition was at 03:00.
@@ -777,7 +786,7 @@ Rule HK 1979 only - Oct 21 3:30 0 -
777786
Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42
778787
8:00 - HKT 1941 Jun 15 3:00
779788
8:00 1:00 HKST 1941 Oct 1 4:00
780-
8:30 - HKT 1941 Dec 25
789+
8:00 0:30 HKWT 1941 Dec 25
781790
9:00 - JST 1945 Nov 18 2:00
782791
8:00 HK HK%sT
783792

@@ -2442,7 +2451,7 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S
24422451
Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1
24432452
8:30 - KST 1912 Jan 1
24442453
9:00 - JST 1945 Sep 8
2445-
9:00 - KST 1954 Mar 21
2454+
9:00 ROK K%sT 1954 Mar 21
24462455
8:30 ROK K%sT 1961 Aug 10
24472456
9:00 ROK K%sT
24482457
Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
@@ -3627,7 +3636,7 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
36273636
# and in South Vietnam in particular (after 1954):
36283637
# To 07:00 on 1911-05-01.
36293638
# To 08:00 on 1942-12-31 at 23:00.
3630-
# To 09:00 in 1945-03-14 at 23:00.
3639+
# To 09:00 on 1945-03-14 at 23:00.
36313640
# To 07:00 on 1945-09-02 in Vietnam.
36323641
# To 08:00 on 1947-04-01 in French-controlled Indochina.
36333642
# To 07:00 on 1955-07-01 in South Vietnam.

0 commit comments

Comments
 (0)