Skip to content

Commit 53ecc07

Browse files
committed
8210958: Rename "make run-test" to "make test"
Reviewed-by: erikj
1 parent 80aa383 commit 53ecc07

11 files changed

Lines changed: 175 additions & 126 deletions

File tree

doc/testing.html

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ <h1 class="title">Testing the JDK</h1>
1818
</header>
1919
<nav id="TOC">
2020
<ul>
21-
<li><a href="#using-the-run-test-framework">Using the run-test framework</a><ul>
21+
<li><a href="#using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</a><ul>
2222
<li><a href="#configuration">Configuration</a></li>
2323
</ul></li>
2424
<li><a href="#test-selection">Test selection</a><ul>
2525
<li><a href="#jtreg">JTReg</a></li>
2626
<li><a href="#gtest">Gtest</a></li>
27+
<li><a href="#special-tests">Special tests</a></li>
2728
</ul></li>
2829
<li><a href="#test-results-and-summary">Test results and summary</a></li>
2930
<li><a href="#test-suite-control">Test suite control</a><ul>
@@ -32,22 +33,23 @@ <h1 class="title">Testing the JDK</h1>
3233
</ul></li>
3334
</ul>
3435
</nav>
35-
<h2 id="using-the-run-test-framework">Using the run-test framework</h2>
36+
<h2 id="using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</h2>
3637
<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>
37-
<p>The main target &quot;run-test&quot; uses the jdk-image as the tested product. There is also an alternate target &quot;exploded-run-test&quot; 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>
38+
<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>
39+
<p>Previously, <code>make test</code> was used invoke an old system for running test, 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. The old system can still be accessed for some time using <code>cd test &amp;&amp; make</code>.</p>
3840
<p>Some example command-lines:</p>
39-
<pre><code>$ make run-test-tier1
40-
$ make run-test-jdk_lang JTREG=&quot;JOBS=8&quot;
41-
$ make run-test TEST=jdk_lang
42-
$ make run-test-only TEST=&quot;gtest:LogTagSet gtest:LogTagSetDescriptions&quot; GTEST=&quot;REPEAT=-1&quot;
43-
$ make run-test TEST=&quot;hotspot:hotspot_gc&quot; JTREG=&quot;JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;
44-
$ make run-test TEST=&quot;jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java&quot;
45-
$ make exploded-run-test TEST=tier2</code></pre>
41+
<pre><code>$ make test-tier1
42+
$ make test-jdk_lang JTREG=&quot;JOBS=8&quot;
43+
$ make test TEST=jdk_lang
44+
$ make test-only TEST=&quot;gtest:LogTagSet gtest:LogTagSetDescriptions&quot; GTEST=&quot;REPEAT=-1&quot;
45+
$ make test TEST=&quot;hotspot:hotspot_gc&quot; JTREG=&quot;JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;
46+
$ make test TEST=&quot;jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java&quot;
47+
$ make exploded-test TEST=tier2</code></pre>
4648
<h3 id="configuration">Configuration</h3>
4749
<p>To be able to run JTReg tests, <code>configure</code> needs to know where to find the JTReg test framework. If it is not picked up automatically by configure, use the <code>--with-jtreg=&lt;path to jtreg home&gt;</code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc. (An alternative is to set the <code>JT_HOME</code> environment variable to point to the JTReg home before running <code>configure</code>.)</p>
4850
<h2 id="test-selection">Test selection</h2>
49-
<p>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 <code>TEST</code> 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.</p>
50-
<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 run-test-tier1</code> is equivalent to <code>make run-test TEST=&quot;tier1&quot;</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>run-test TEST=&quot;x&quot;</code> solution needs to be used.</p>
51+
<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>
52+
<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>
5153
<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>
5254
<h3 id="jtreg">JTReg</h3>
5355
<p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
@@ -59,6 +61,14 @@ <h3 id="gtest">Gtest</h3>
5961
<p>Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just <code>gtest</code>, or as a fully qualified test descriptor <code>gtest:all</code>.</p>
6062
<p>If you want, you can single out an individual test or a group of tests, for instance <code>gtest:LogDecorations</code> or <code>gtest:LogDecorations.level_test_vm</code>. This can be particularly useful if you want to run a shaky test repeatedly.</p>
6163
<p>For Gtest, there is a separate test suite for each JVM variant. The JVM variant is defined by adding <code>/&lt;variant&gt;</code> to the test descriptor, e.g. <code>gtest:Log/client</code>. If you specify no variant, gtest will run once for each JVM variant present (e.g. server, client). So if you only have the server JVM present, then <code>gtest:all</code> will be equivalent to <code>gtest:all/server</code>.</p>
64+
<h3 id="special-tests">Special tests</h3>
65+
<p>A handful of odd tests that are not covered by any other testing framework are accessible using the <code>special:</code> test descriptor. Currently, this includes <code>hotspot-internal</code>, <code>failure-handler</code> and <code>make</code>.</p>
66+
<ul>
67+
<li><p>Hotspot legacy internal testing (run using <code>-XX:+ExecuteInternalVMTests</code>) is run using <code>special:hotspot-internal</code> or just <code>hotspot-internal</code> as test descriptor, and will only work on a debug JVM.</p></li>
68+
<li><p>Failure handler testing is run using <code>special:failure-handler</code> or just <code>failure-handler</code> as test descriptor.</p></li>
69+
<li><p>Tests for the build system, including both makefiles and related functionality, is run using <code>special:make</code> or just <code>make</code> as test descriptor. This is equivalent to <code>special:make:all</code>.</p>
70+
<p>A specific make test can be run by supplying it as argument, e.g. <code>special:make:idea</code>. As a special syntax, this can also be expressed as <code>make-idea</code>, which allows for command lines as <code>make test-make-idea</code>.</p></li>
71+
</ul>
6272
<h2 id="test-results-and-summary">Test results and summary</h2>
6373
<p>At the end of the test run, a summary of all tests run will be presented. This will have a consistent look, regardless of what test suites were used. This is a sample summary:</p>
6474
<pre><code>==============================
@@ -72,7 +82,7 @@ <h2 id="test-results-and-summary">Test results and summary</h2>
7282
TEST FAILURE</code></pre>
7383
<p>Tests where the number of TOTAL tests does not equal the number of PASSed tests will be considered a test failure. These are marked with the <code>&gt;&gt; ... &lt;&lt;</code> marker for easy identification.</p>
7484
<p>The classification of non-passed tests differs a bit between test suites. In the summary, ERROR is used as a catch-all for tests that neither passed nor are classified as failed by the framework. This might indicate test framework error, timeout or other problems.</p>
75-
<p>In case of test failures, <code>make run-test</code> will exit with a non-zero exit value.</p>
85+
<p>In case of test failures, <code>make test</code> will exit with a non-zero exit value.</p>
7686
<p>All tests have their result stored in <code>build/$BUILD/test-results/$TEST_ID</code>, where TEST_ID is a path-safe conversion from the fully qualified test descriptor, e.g. for <code>jtreg:jdk/test:tier1</code> the TEST_ID is <code>jtreg_jdk_test_tier1</code>. This path is also printed in the log at the end of the test run.</p>
7787
<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>
7888
<h2 id="test-suite-control">Test suite control</h2>

doc/testing.md

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
% Testing the JDK
22

3-
## Using the run-test framework
3+
## Using "make test" (the run-test framework)
44

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

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

15+
Previously, `make test` was used invoke an old system for running test, and
16+
`make run-test` was used for the new test framework. For backward compatibility
17+
with scripts and muscle memory, `run-test` (and variants like
18+
`exploded-run-test` or `run-test-tier1`) are kept as aliases. The old system
19+
can still be accessed for some time using `cd test && make`.
20+
1521
Some example command-lines:
1622

17-
$ make run-test-tier1
18-
$ make run-test-jdk_lang JTREG="JOBS=8"
19-
$ make run-test TEST=jdk_lang
20-
$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
21-
$ make run-test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
22-
$ make run-test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
23-
$ make exploded-run-test TEST=tier2
23+
$ make test-tier1
24+
$ make test-jdk_lang JTREG="JOBS=8"
25+
$ make test TEST=jdk_lang
26+
$ make test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
27+
$ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
28+
$ make test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
29+
$ make exploded-test TEST=tier2
2430

2531
### Configuration
2632

@@ -33,16 +39,16 @@ environment variable to point to the JTReg home before running `configure`.)
3339

3440
## Test selection
3541

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

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

4753
The test specifications given in `TEST` is parsed into fully qualified test
4854
descriptors, which clearly and unambigously show which tests will be run. As an
@@ -98,6 +104,27 @@ is defined by adding `/<variant>` to the test descriptor, e.g.
98104
variant present (e.g. server, client). So if you only have the server JVM
99105
present, then `gtest:all` will be equivalent to `gtest:all/server`.
100106

107+
### Special tests
108+
109+
A handful of odd tests that are not covered by any other testing framework are
110+
accessible using the `special:` test descriptor. Currently, this includes
111+
`hotspot-internal`, `failure-handler` and `make`.
112+
113+
* Hotspot legacy internal testing (run using `-XX:+ExecuteInternalVMTests`)
114+
is run using `special:hotspot-internal` or just `hotspot-internal` as test
115+
descriptor, and will only work on a debug JVM.
116+
117+
* Failure handler testing is run using `special:failure-handler` or just
118+
`failure-handler` as test descriptor.
119+
120+
* Tests for the build system, including both makefiles and related
121+
functionality, is run using `special:make` or just `make` as test
122+
descriptor. This is equivalent to `special:make:all`.
123+
124+
A specific make test can be run by supplying it as argument, e.g.
125+
`special:make:idea`. As a special syntax, this can also be expressed as
126+
`make-idea`, which allows for command lines as `make test-make-idea`.
127+
101128
## Test results and summary
102129

103130
At the end of the test run, a summary of all tests run will be presented. This
@@ -123,7 +150,7 @@ the summary, ERROR is used as a catch-all for tests that neither passed nor are
123150
classified as failed by the framework. This might indicate test framework
124151
error, timeout or other problems.
125152

126-
In case of test failures, `make run-test` will exit with a non-zero exit value.
153+
In case of test failures, `make test` will exit with a non-zero exit value.
127154

128155
All tests have their result stored in `build/$BUILD/test-results/$TEST_ID`,
129156
where TEST_ID is a path-safe conversion from the fully qualified test

make/Help.gmk

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2012, 2018, 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
@@ -55,10 +55,10 @@ help:
5555
$(info $(_) make install # Install the generated images locally)
5656
$(info $(_) make reconfigure # Rerun configure with the same arguments as last time)
5757
$(info $(_) make help # Give some help on using make)
58-
$(info $(_) make test # Run tests, default is all tests (see TEST below))
59-
$(info $(_) make run-test-<test> # Run test, e.g. run-test-tier1)
60-
$(info $(_) make run-test TEST=<t> # Run test(s) given by TEST specification)
61-
$(info $(_) make exploded-run-test TEST=<t> # Run test(s) on the exploded image instead of)
58+
$(info $(_) make check # Run basic testing (currently tier1))
59+
$(info $(_) make test-<test> # Run test, e.g. test-tier1)
60+
$(info $(_) make test TEST=<t> # Run test(s) given by TEST specification)
61+
$(info $(_) make exploded-test TEST=<t> # Run test(s) on the exploded image instead of)
6262
$(info $(_) # the full jdk image)
6363
$(info )
6464
$(info Targets for cleaning)
@@ -99,10 +99,12 @@ help:
9999
$(info $(_) TEST_JOBS=<n> # Run <n> parallel test jobs)
100100
$(info $(_) CONF_CHECK=<method> # What to do if spec file is out of date)
101101
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
102-
$(info $(_) make test TEST=<test> # Only run the given test or tests, e.g.)
103-
$(info $(_) # make test TEST="jdk_lang jdk_net")
104-
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness for run-test)
105-
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness for run-test)
102+
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
103+
$(info $(_) # make test TEST="jdk_lang gtest:all")
104+
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness)
105+
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness)
106+
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
107+
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
106108
$(info )
107109
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))),\
108110
$(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration.))

0 commit comments

Comments
 (0)