Import Upstream version 6.1+2
Emmanuel Bourg
1 year, 1 month ago
0 | name: Build and Test JTReg | |
1 | ||
2 | on: | |
3 | push: | |
4 | branches-ignore: | |
5 | - master | |
6 | ||
7 | jobs: | |
8 | ||
9 | linux-x64: | |
10 | runs-on: ubuntu-20.04 | |
11 | ||
12 | steps: | |
13 | - name: Checkout the source | |
14 | uses: actions/checkout@v2 | |
15 | with: | |
16 | path: jtreg | |
17 | fetch-depth: 0 | |
18 | ||
19 | - name: build | |
20 | working-directory: jtreg | |
21 | shell: bash | |
22 | run: bash make/build.sh --jdk ${JAVA_HOME_8_X64} | |
23 | ||
24 | - name: upload artifact | |
25 | uses: actions/upload-artifact@v2 | |
26 | with: | |
27 | name: jtreg | |
28 | path: jtreg/build/images/jtreg | |
29 | ||
30 | - name: test | |
31 | working-directory: jtreg | |
32 | shell: bash | |
33 | run: | |
34 | MAKE_ARGS=test | |
35 | HEADLESS=1 | |
36 | JDK8HOME=${JAVA_HOME_8_X64} | |
37 | bash make/build.sh --jdk ${JAVA_HOME_8_X64} --skip-download | |
38 |
0 | [general] | |
0 | 1 | project=code-tools |
1 | 2 | comments=lax |
2 | tags=lax | |
3 | jbs=CODETOOLS | |
4 | ||
5 | [checks] | |
6 | error=author,committer,reviewers,merge,issues,executable,symlink,message,whitespace | |
7 | ||
8 | [repository] | |
9 | tags=jtreg(?:4\.1-b[0-9]{2}|5\.[01]-b[0-9]{2}|6|-[6789](?:\.[0-9]+)?+[0-9]+) | |
10 | branches= | |
11 | ||
12 | [census] | |
13 | version=0 | |
14 | domain=openjdk.org | |
15 | ||
16 | [checks "whitespace"] | |
17 | files=.*\.java|.*\.m|.*\.mm|.*\.gmk|.*\.m4|.*\.ac|Makefile | |
18 | ignore-tabs=.*\.gmk|Makefile | |
19 | ||
20 | [checks "merge"] | |
21 | message=Merge | |
22 | ||
23 | [checks "reviewers"] | |
24 | ignore=duke | |
25 | ||
26 | [checks "committer"] | |
27 | role=committer | |
28 | ||
29 | [checks "issues"] | |
30 | pattern=^(79[0-9]{5}): (\S.*)$ |
0 | Building The Regression Test Harness for the OpenJDK platform: jtreg | |
1 | ||
2 | (This information is also available at http://openjdk.java.net/jtreg/build.html) | |
3 | ||
4 | jtreg depends on a number of external components: | |
5 | JT Harness, TestNG, JUnit, AsmTools, Ant, and JCov. | |
6 | ||
7 | The fundamental way to build jtreg is with GNU make, specifying where to find | |
8 | those external components, but a script is also available that will download | |
9 | appropriate copies of those components before building jtreg. | |
10 | ||
11 | Building jtreg with the build-all.sh script | |
12 | ||
13 | This is the recommended way to build jtreg, for those that want a simple, | |
14 | basic way to build jtreg. | |
15 | ||
16 | The script is intended to be run in a Unix-like shell, such as bash on Linux or | |
17 | Mac OS X, or with Cygwin or WSL on Windows. It takes one argument which is the | |
18 | installation of JDK to be used to build jtreg. In addition, Ant must be on your | |
19 | execution path as well as a suitable version of Java to run Ant. The version of | |
20 | JDK must be either JDK 7 or JDK 8. | |
21 | ||
22 | % cd jtreg-root-directory | |
23 | % sh make/build-all.sh JDK-directory | |
24 | ||
25 | The script will create a build sub-directory, download and build dependencies, | |
26 | and finally build jtreg itself. The resulting image will be in | |
27 | build/images/jtreg. | |
28 | ||
29 | No environment variables need to be specified to get a standard build of jtreg. | |
30 | However, the following environment variables may be set, for a non-standard | |
31 | build: | |
32 | ||
33 | ASMTOOLS_VERSION, JCOV_VERSION, JTHARNESS_VERSION | |
34 | These variables may be set to the name of a tag identifying a specific | |
35 | changeset in the corresponding OpenJDK repository, or to the pseudo-tag "tip". | |
36 | ||
37 | MAKE_ARGS | |
38 | Arguments for the internal invocation of "make". The default is to just build | |
39 | jtreg, but setting this environment variable allows additional targets, such | |
40 | as test targets, to be run. The explicit target to build jtreg is "build"; | |
41 | the target to run some basic sanity tests is "quick-test"; and the target | |
42 | to run all tests is "test". You can also use the make "-j" option to build | |
43 | targets in parallel. For example: | |
44 | MAKE_ARGS="-j 4 build quick-test" sh make/build-all.sh | |
45 | ||
46 | UNZIP_OPTS, WGET_OPTS | |
47 | These two variables default to "-q", to suppress unnecessary output. | |
48 | You can set these variables to change the default behavior. | |
49 | ||
50 | Building jtreg with GNU Make | |
51 | ||
52 | The Makefile is in make/Makefile, and creates deliverables in the build/ | |
53 | directory, similar to OpenJDK. By default, the build file just builds an image | |
54 | for jtreg. You can build jtreg from a Unix-like command shell with the following | |
55 | commands: | |
56 | ||
57 | % cd <jtreg-root-directory> | |
58 | % make -C make | |
59 | ||
60 | Dependencies | |
61 | ||
62 | jtreg has a number of build dependencies. These can be set with values on the | |
63 | make command line or with values in make/Defs.gmk. You can also include the | |
64 | appropriate license files in the jtreg image, by setting the appropriate make | |
65 | variables. These are documented in make/Defs.gmk | |
66 | ||
67 | JDK 1.8 (or better) | |
68 | Set JDKHOME to the JDK or equivalent used to build jtreg. It must be | |
69 | equivalent to JDK 1.8 or later. | |
70 | ||
71 | JT Harness | |
72 | See https://wiki.openjdk.java.net/display/CodeTools/JT+Harness. | |
73 | Set JTHARNESS_HOME to the installed copy of the version of JT Harness to be | |
74 | used. It should be version 5.0 or better. | |
75 | ||
76 | Ant | |
77 | See http://ant.apache.org/. Set ANTHOME to an installed copy of Ant. It | |
78 | should be version 1.9.x. or better. | |
79 | ||
80 | AsmTools | |
81 | See https://wiki.openjdk.java.net/display/CodeTools/asmtools. | |
82 | Set ASMTOOLS_HOME to the installed copy of the version of AsmTools to be | |
83 | used. It should be version 6.0 or better. | |
84 | ||
85 | Note: Do not confuse this component with ASM bytecode engineering library | |
86 | available at http://asm.ow2.org/ | |
87 | ||
88 | JUnit | |
89 | See http://junit.org/. The recommended version is currently JUnit 4.10. | |
90 | ||
91 | TestNG | |
92 | See http://testng.org/. The recommended version is currently 6.9.5. | |
93 | ||
94 | The following dependencies are optional. | |
95 | ||
96 | JCov | |
97 | See https://wiki.openjdk.java.net/display/CodeTools/jcov. | |
98 | Set JCOV_HOME to the installed copy of the version of JCov to be used. | |
99 | It should be version 2.0 or better. | |
100 | ||
101 | JDK 1.5 | |
102 | This is used when running some of the tests. Set JDK5HOME to run these | |
103 | tests. It need not be set if you are just building jtreg. | |
104 | ||
105 | JDK 1.6 | |
106 | This is used when running some of the tests. Set JDK6HOME to run these | |
107 | tests. It need not be set if you are just building jtreg. | |
108 | ||
109 | JDK 1.7 | |
110 | This is used when running some of the tests. Set JDK7HOME to run these | |
111 | tests. It need not be set if you are just building jtreg. | |
112 | ||
113 | JDK 1.8 | |
114 | This is used when running some of the tests. Set JDK8HOME to run these | |
115 | tests. It need not be set if you are just building jtreg. | |
116 | ||
117 | JDK 9 | |
118 | This is used when running some of the tests. Set JDK9HOME to run these | |
119 | tests. It need not be set if you are just building jtreg. | |
120 | ||
121 | JDK 14 | |
122 | This is used when running some of the tests. Set JDK14HOME to run these | |
123 | tests. It need not be set if you are just building jtreg. | |
124 | ||
125 | Running jtreg Self-Tests | |
126 | ||
127 | The tests can be invoked with individual make targets, or collectively via the | |
128 | "test" target. | |
129 | ||
130 | Some of the tests need to pop up windows while they execute. No interaction with | |
131 | these windows is normally required. Since this can be a problem on a headless | |
132 | server machine, and an annoyance on a personal workstation, the tests will | |
133 | attempt to use VNC to create a dummy X-server for use by the tests while they | |
134 | are running. Various implementations of VNC are available, such as from | |
135 | http://www.realvnc.com/. Using VNC is optional; it is not required in order to | |
136 | run the tests. | |
137 | ||
138 | By default, VNC will be used if vncserver is found on your execution path, or | |
139 | if VNC_HOME points to an installed copy of VNC. To explicitly disable the use of | |
140 | VNC, set the VNC environment variable to one of false, off, no, or 0. Unless | |
141 | explicitly disabled, the tests will check the following: | |
142 | ||
143 | * You must have a password set in $HOME/.vnc/passwd. This is the standard | |
144 | location used by the vncserver command. | |
145 | * If you set the environment variable VNC_HOME, it will be prepended to your | |
146 | execution path to find vncserver. | |
147 | * vncserver must be on your execution path, after VNC_HOME has been added, | |
148 | if set. | |
149 | ||
150 | If the tests find any issue with using VNC, it will not be used. If VNC is used | |
151 | to create a dummy X server, the server will be terminated when the test is | |
152 | complete. | |
153 | ||
154 | The logic for using VNC is encapsulated within the script make/display.sh. | |
155 | ||
156 | Building jtreg with Ant | |
157 | ||
158 | It is possible to build jtreg with Ant, but this is primarily intended as a | |
159 | convenience while working on the jtreg source code. If you are building jtreg | |
160 | to run OpenJDK tests, it is recommended that you build jtreg using the Makefile, | |
161 | perhaps via the build-all.sh wrapper script. | |
162 | ||
163 | The build file is in make/build.xml; it creates intermediate files in the build/ | |
164 | directory and deliverables in the dist/ directory. By default, the build file | |
165 | just builds jtreg, but does not run any tests. You can build jtreg from a | |
166 | Unix-like command shell with the following commands: | |
167 | ||
168 | % cd jtreg-root-directory | |
169 | % ant -f make/build.xml | |
170 | ||
171 | You can also use this build file when creating a NetBeans free form project with | |
172 | an existing build file. | |
173 | ||
174 | Dependencies | |
175 | ||
176 | Some of the tasks that are used are listed as "Optional Tasks" in the Ant | |
177 | manual. You may need to make sure that these tasks are available for use by Ant. | |
178 | For example, on Ubuntu Linux these tasks are in the ant-optional package. | |
179 | ||
180 | Running Tests | |
181 | ||
182 | Some of the tests can be invoked with individual targets beginning | |
183 | "-jtreg-test-", or collectively via the "jtreg-test" target. (The use of | |
184 | "jtreg-test" rather than "test" is to protect against interactions with JUnit in | |
185 | older versions of NetBeans.) | |
186 | ||
187 | Using the IntelliJ IDE | |
188 | ||
189 | The jtreg repo also contains a plugin for the IntelliJ IDE. | |
190 | This is a convenience plugin which adds jtreg capabilities to the IntelliJ IDE. | |
191 | With this plugin, OpenJDK developers can write, run, and debug jtreg tests | |
192 | without leaving their IDE environment. For more details, see the file | |
193 | `plugins/idea/README.md` in this repo. | |
194 | ||
195 |
22 | 22 | |
23 | 23 | % cd jtreg-root-directory |
24 | 24 | % sh make/build.sh --jdk JDK-directory |
25 | ||
26 | If your shell is not compatible with `bash`, you may need to invoke `bash` explicitly: | |
27 | ||
28 | % bash make/build.sh --jdk JDK-directory | |
25 | 29 | |
26 | 30 | The script will create a build sub-directory, download and build dependencies, |
27 | 31 | and finally build jtreg itself. The resulting image will be in |
112 | 116 | * JDK 14: |
113 | 117 | This is used when running some of the tests. Set `JDK14HOME` to run these |
114 | 118 | tests. It need not be set if you are just building jtreg. |
115 | ||
119 | ||
120 | * JDK 18: | |
121 | This is used when running some of the tests. Set `JDK18HOME` to run these | |
122 | tests. It need not be set if you are just building jtreg. | |
123 | ||
116 | 124 | The recommended versions are also defined in `make/build-support/version-numbers`. |
117 | 125 | |
118 | 126 | ## Running jtreg Self-Tests |
183 | 191 | This is a convenience plugin which adds jtreg capabilities to the IntelliJ IDE. |
184 | 192 | With this plugin, OpenJDK developers can write, run, and debug jtreg tests |
185 | 193 | without leaving their IDE environment. For more details, see the file |
186 | _plugins/idea/README.md_ in this repo. | |
194 | [plugins/idea/README.md](plugins/idea/README.md) in this repo. |
38 | 38 | |
39 | 39 | #---------------------------------------------------------------------- |
40 | 40 | # |
41 | # Support for Cygwin | |
41 | # Support for Cygwin and MSYS2 (which may identify as MSYS, MINGW32 or MINGW64 (the default)) | |
42 | 42 | |
43 | 43 | SYSTEM_UNAME := $(shell uname) |
44 | 44 | |
52 | 52 | |
53 | 53 | ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME))) |
54 | 54 | USING_CYGWIN = true |
55 | endif | |
56 | ||
57 | ifdef USING_CYGWIN | |
55 | USING_CYGWIN_OR_USING_MSYS = true | |
56 | endif | |
57 | ||
58 | ifneq (,$(findstring MSYS,$(SYSTEM_UNAME))$(findstring MINGW,$(SYSTEM_UNAME))) | |
59 | USING_MSYS = true | |
60 | USING_CYGWIN_OR_USING_MSYS = true | |
61 | endif | |
62 | ||
63 | ifdef USING_CYGWIN_OR_USING_MSYS | |
58 | 64 | define FullPath |
59 | 65 | $(shell cygpath -a -m $1 2> $(DEV_NULL)) |
60 | 66 | endef |
147 | 153 | OLD_JAVAC_SOURCE_TARGET = -source 1.2 -target 1.1 |
148 | 154 | AGENT_JAVAC_SOURCE_TARGET = -source 5 -target 5 |
149 | 155 | TOOL_JAVAC_SOURCE_TARGET = -source 8 -target 8 |
156 | REGTEST_TOOL_PATCH_JAVA_BASE_OPTIONS = | |
157 | else | |
158 | EXTRA_LINT_OPTS = -rawtypes,-unchecked | |
159 | REGTEST_TOOL_PATCH_JAVA_BASE_OPTIONS = --patch-module java.base=$(JAVADIR) | |
150 | 160 | endif |
151 | 161 | |
152 | 162 | ifdef JDK5HOME |
159 | 169 | # for files needed to run othervm tests on oldest supported platforms |
160 | 170 | REGTEST_OLD_JAVAC = $(JDKHOME)/bin/javac |
161 | 171 | REGTEST_OLD_JAVAC_OPTIONS = \ |
162 | $(OLD_JAVAC_SOURCE_TARGET) $(JDK5_BOOTCLASSPATH) -Xlint:all,-options -Werror | |
172 | $(OLD_JAVAC_SOURCE_TARGET) $(JDK5_BOOTCLASSPATH) -Xlint:all,-options,-deprecation,$(EXTRA_LINT_OPTS) -Werror | |
163 | 173 | |
164 | 174 | # for files needed to run agentvm tests (on platforms back to JDK 1.5) |
165 | 175 | REGTEST_AGENT_JAVAC = $(JDKHOME)/bin/javac |
166 | 176 | REGTEST_AGENT_JAVAC_OPTIONS = \ |
167 | $(AGENT_JAVAC_SOURCE_TARGET) $(JDK5_BOOTCLASSPATH) -Xlint:all,-options -Werror | |
177 | $(AGENT_JAVAC_SOURCE_TARGET) $(JDK5_BOOTCLASSPATH) -Xlint:all,-options,-deprecation,$(EXTRA_LINT_OPTS) -Werror | |
168 | 178 | |
169 | 179 | # for files needed for jtreg tool |
170 | 180 | REGTEST_TOOL_JAVAC = $(JDKHOME)/bin/javac |
171 | 181 | REGTEST_TOOL_JAVAC_OPTIONS = \ |
172 | $(TOOL_JAVAC_SOURCE_TARGET) $(JDK8_BOOTCLASSPATH) -Xlint:all,-options -Werror | |
182 | $(TOOL_JAVAC_SOURCE_TARGET) $(JDK8_BOOTCLASSPATH) -Xlint:all,-options,-deprecation -Werror | |
173 | 183 | |
174 | 184 | #----- JavaTest: https://wiki.openjdk.java.net/display/CodeTools/JT+Harness |
175 | 185 | # |
59 | 59 | .NO_PARALLEL: clean |
60 | 60 | |
61 | 61 | sanity: |
62 | ifdef JDK15HOME | |
63 | @echo "JDK15HOME = $(JDK15HOME)" | |
62 | ifdef JDK1_1HOME | |
63 | @echo "JDK1_1HOME = $(JDK1_1HOME)" | |
64 | 64 | endif |
65 | ifdef JDK16HOME | |
66 | @echo "JDK16HOME = $(JDK16HOME)" | |
65 | ifdef JDK5HOME | |
66 | @echo "JDK5HOME = $(JDK5HOME)" | |
67 | 67 | endif |
68 | ifdef JDK17HOME | |
69 | @echo "JDK17HOME = $(JDK17HOME)" | |
68 | ifdef JDK6HOME | |
69 | @echo "JDK6HOME = $(JDK6HOME)" | |
70 | endif | |
71 | ifdef JDK7HOME | |
72 | @echo "JDK7HOME = $(JDK7HOME)" | |
73 | endif | |
74 | ifdef JDK8HOME | |
75 | @echo "JDK8HOME = $(JDK8HOME)" | |
76 | endif | |
77 | ifdef JDK9HOME | |
78 | @echo "JDK9HOME = $(JDK9HOME)" | |
79 | endif | |
80 | ifdef JDK14HOME | |
81 | @echo "JDK14HOME = $(JDK14HOME)" | |
70 | 82 | endif |
71 | 83 | ifdef JDK18HOME |
72 | 84 | @echo "JDK18HOME = $(JDK18HOME)" |
73 | 85 | endif |
74 | 86 | @echo "JDKHOME = $(JDKHOME)" |
75 | ifdef JAVAHELP_HOME | |
76 | @echo "JAVAHELP_HOME = $(JAVAHELP_HOME)" | |
77 | endif | |
78 | 87 | @echo "JAVATEST_HOME = $(JAVATEST_HOME)" |
79 | 88 | ifneq ($(JTHARNESS_HOME), $(JAVATEST_HOME)) |
80 | 89 | @echo "JTHARNESS_HOME = $(JTHARNESS_HOME)" |
0 | #!/bin/bash | |
1 | ||
2 | # | |
3 | # Copyright (c) 2017, 2020, 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. Oracle designates this | |
9 | # particular file as subject to the "Classpath" exception as provided | |
10 | # by Oracle in the LICENSE file that accompanied this code. | |
11 | # | |
12 | # This code is distributed in the hope that it will be useful, but WITHOUT | |
13 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | # version 2 for more details (a copy is included in the LICENSE file that | |
16 | # accompanied this code). | |
17 | # | |
18 | # You should have received a copy of the GNU General Public License version | |
19 | # 2 along with this work; if not, write to the Free Software Foundation, | |
20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
21 | # | |
22 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
23 | # or visit www.oracle.com if you need additional information or have any | |
24 | # questions. | |
25 | # | |
26 | ||
27 | set -e | |
28 | set -u | |
29 | ||
30 | if [ "$#" -ne 1 ]; then | |
31 | echo "Usage: $0 /path/to/jdk/1.8/image" >&2 | |
32 | exit 1 | |
33 | fi | |
34 | ||
35 | if [ ! -d $1 ]; then | |
36 | echo "Error: '$1' is not a directory" >&2 | |
37 | exit 1 | |
38 | fi | |
39 | ||
40 | if [ ! -x $1/bin/java ]; then | |
41 | echo "Error: Could not find an executable binary at '$1/bin/java'" >&2 | |
42 | exit 1 | |
43 | fi | |
44 | ||
45 | JAVA_VERSION=$($1/bin/java -version 2>&1 | grep "^.* version \".*\"$" | sed 's/.*\"\(.*\)\".*/\1/') | |
46 | ||
47 | if case ${JAVA_VERSION} in 1.8*) false ;; *) true; esac; then | |
48 | echo "Error: Expected a path to JDK with version 1.8, got version ${JAVA_VERSION}" >&2 | |
49 | exit 1 | |
50 | fi | |
51 | ||
52 | case `uname` in CYGWIN*) CYGWIN=1 ;; *) CYGWIN=0 ;; esac | |
53 | ||
54 | native_path() { | |
55 | if [ $CYGWIN -eq 1 ]; then echo `cygpath -w $1`; else echo $1; fi | |
56 | } | |
57 | ||
58 | mixed_path() { | |
59 | if [ $CYGWIN -eq 1 ]; then echo `cygpath -m $1`; else echo $1; fi | |
60 | } | |
61 | ||
62 | get_scm_type() { | |
63 | if [ -d .hg ]; then | |
64 | echo "HG" | |
65 | elif [ -d .git ]; then | |
66 | echo "GIT" | |
67 | else | |
68 | echo "Error: unrecognized repository, it must be Git or Mercurial" >&2 | |
69 | exit 1 | |
70 | fi | |
71 | } | |
72 | ||
73 | SCM_TYPE=`get_scm_type` | |
74 | ||
75 | get_root() { | |
76 | case $SCM_TYPE in | |
77 | HG) hg root ;; | |
78 | GIT) git rev-parse --show-toplevel ;; | |
79 | *) echo "Error: unknown SCM" >&2 ; exit 1 ;; | |
80 | esac | |
81 | } | |
82 | ||
83 | get_tag_info() { | |
84 | case $SCM_TYPE in | |
85 | HG) hg tags | grep jtreg | head -1 ;; | |
86 | GIT) git tag | grep jtreg | tail -1 ;; | |
87 | *) echo "Error: unknown SCM" >&2 ; exit 1 ;; | |
88 | esac | |
89 | } | |
90 | ||
91 | export JAVA_HOME=$1 | |
92 | export PATH="$JAVA_HOME:$PATH" | |
93 | ||
94 | if [ -n "`which sha1sum`" ]; then | |
95 | SHASUM=sha1sum; | |
96 | elif [ -n "`which shasum`" ]; then | |
97 | SHASUM="shasum -a 1" | |
98 | else | |
99 | echo "Error: can't find shasum or sha1sum" >&2 | |
100 | exit 1 | |
101 | fi | |
102 | ||
103 | UNZIP=unzip | |
104 | UNZIP_OPTS="${UNZIP_OPTS:--q} -u" | |
105 | WGET=wget | |
106 | WGET_OPTS=${WGET_OPTS:--q} | |
107 | ||
108 | ||
109 | ROOT=`get_root` | |
110 | ||
111 | BUILD_DIR=${BUILD_DIR:-${ROOT}/build} | |
112 | ||
113 | if [ "${SKIP_WGET:-}" = "" -a -d ${BUILD_DIR} ]; then | |
114 | echo "Error: Build directory '${BUILD_DIR}' already exists" >&2 | |
115 | exit 1 | |
116 | fi | |
117 | ||
118 | mkdir -p ${BUILD_DIR} | |
119 | ||
120 | WGet() { | |
121 | if [ "${SKIP_WGET:-}" != "" -a -r $2 ]; then | |
122 | echo "Skipping download of $1..." | |
123 | else | |
124 | ${WGET} ${WGET_OPTS} "$1" -O "$2" | |
125 | fi | |
126 | } | |
127 | ||
128 | # DEPENDENCIES | |
129 | ############## | |
130 | ||
131 | APACHE_ANT_URL=https://archive.apache.org/dist/ant/binaries | |
132 | MAVEN_REPO_URL=https://repo1.maven.org/maven2 | |
133 | ||
134 | CODE_TOOLS_URL="${CODE_TOOLS_URL:-https://git.openjdk.java.net}" | |
135 | # The following are Mercurial tags for the corresponding OpenJDK Code Tools repo | |
136 | ASMTOOLS_VERSION=${ASMTOOLS_VERSION:-7.0-b08} # early access for 7.0 | |
137 | JTHARNESS_VERSION=${JTHARNESS_VERSION:-jt6.0-b11} # early access for 6.0 | |
138 | JCOV_VERSION=${JCOV_VERSION:-jcov3.0-b05} # jcov3.0, ASM 6.2 | |
139 | ||
140 | # ANT | |
141 | ##### | |
142 | ||
143 | ANT_DIR=${BUILD_DIR}/ant | |
144 | mkdir -p ${ANT_DIR} | |
145 | ||
146 | ANT_VERSION=${ANT_VERSION:-apache-ant-1.9.4} | |
147 | ANT_ZIP=${ANT_DIR}/${ANT_VERSION}.zip | |
148 | WGet ${APACHE_ANT_URL}/${ANT_VERSION}-bin.zip ${ANT_ZIP} | |
149 | echo "ec57a35eb869a307abdfef8712f3688fff70887f ${ANT_ZIP}" | ${SHASUM} --check - | |
150 | ${UNZIP} ${UNZIP_OPTS} -d ${ANT_DIR} ${ANT_ZIP} | |
151 | ||
152 | ANT_JAR=${ANT_DIR}/${ANT_VERSION}/lib/ant.jar | |
153 | ANT=${ANT_DIR}/${ANT_VERSION}/bin/ant | |
154 | ||
155 | # ASMTOOLS | |
156 | ########## | |
157 | ||
158 | ASMTOOLS_BUILD_DIR=${BUILD_DIR}/asmtools | |
159 | mkdir -p ${ASMTOOLS_BUILD_DIR} | |
160 | ||
161 | # Build asmtools | |
162 | ASMTOOLS_SRC_ZIP=${ASMTOOLS_BUILD_DIR}/source.zip | |
163 | WGet ${CODE_TOOLS_URL}/asmtools/archive/${ASMTOOLS_VERSION}.zip ${ASMTOOLS_SRC_ZIP} | |
164 | ${UNZIP} ${UNZIP_OPTS} -d ${ASMTOOLS_BUILD_DIR} ${ASMTOOLS_SRC_ZIP} | |
165 | ||
166 | if [ "${ASMTOOLS_VERSION}" = "tip" ]; then | |
167 | ASMTOOLS_VERSION=`cd ${ASMTOOLS_BUILD_DIR} ; ls -d asmtools-* | sed -e 's/asmtools-//'` | |
168 | fi | |
169 | ||
170 | ASMTOOLS_SRC=${ASMTOOLS_BUILD_DIR}/asmtools-${ASMTOOLS_VERSION} | |
171 | ASMTOOLS_DIST=${ASMTOOLS_BUILD_DIR}/build | |
172 | ${ANT} -DBUILD_DIR=`native_path ${ASMTOOLS_DIST}` -f `native_path ${ASMTOOLS_SRC}/build/build.xml` | |
173 | ASMTOOLS_JAR=${ASMTOOLS_DIST}/binaries/lib/asmtools.jar | |
174 | ASMTOOLS_LICENSE=${ASMTOOLS_SRC}/LICENSE | |
175 | ||
176 | # JAVATEST | |
177 | ########## | |
178 | ||
179 | JTHARNESS_BUILD_DIR=${BUILD_DIR}/jtharness | |
180 | mkdir -p ${JTHARNESS_BUILD_DIR} | |
181 | ||
182 | # Build jtharness | |
183 | JTHARNESS_SRC_ZIP=${JTHARNESS_BUILD_DIR}/source.zip | |
184 | WGet ${CODE_TOOLS_URL}/jtharness/archive/${JTHARNESS_VERSION}.zip ${JTHARNESS_SRC_ZIP} | |
185 | ${UNZIP} ${UNZIP_OPTS} -d ${JTHARNESS_BUILD_DIR} ${JTHARNESS_SRC_ZIP} | |
186 | ||
187 | if [ "${JTHARNESS_VERSION}" = "tip" ]; then | |
188 | JTHARNESS_VERSION=`cd ${JTHARNESS_BUILD_DIR} ; ls -d jtharness-* | sed -e 's/jtharness-//'` | |
189 | fi | |
190 | ||
191 | JTHARNESS_SRC=${JTHARNESS_BUILD_DIR}/jtharness-${JTHARNESS_VERSION} | |
192 | JTHARNESS_DIST=${JTHARNESS_BUILD_DIR}/build | |
193 | ${ANT} -DBUILD_DIR=`native_path ${JTHARNESS_DIST}` -f `native_path ${JTHARNESS_SRC}/build/build.xml` | |
194 | ||
195 | JAVATEST_JAR=${JTHARNESS_DIST}/binaries/lib/javatest.jar | |
196 | JTHARNESS_LICENSE=${JTHARNESS_SRC}/legal/license.txt | |
197 | JTHARNESS_COPYRIGHT=${JTHARNESS_SRC}/legal/copyright.txt | |
198 | ||
199 | # JCOV | |
200 | ###### | |
201 | ||
202 | JCOV_BUILD_DIR=${BUILD_DIR}/jcov | |
203 | mkdir -p ${JCOV_BUILD_DIR} | |
204 | ||
205 | # Get jcov dependencies | |
206 | JCOV_DEPS_DIR=${JCOV_BUILD_DIR}/deps | |
207 | mkdir -p ${JCOV_DEPS_DIR} | |
208 | ||
209 | ASM_JAR=${JCOV_DEPS_DIR}/asm-6.2.jar | |
210 | ASM_JAR_CHECKSUM='1b6c4ff09ce03f3052429139c2a68e295cae6604' | |
211 | WGet ${MAVEN_REPO_URL}/org/ow2/asm/asm/6.2/asm-6.2.jar ${ASM_JAR} | |
212 | echo "${ASM_JAR_CHECKSUM} ${ASM_JAR}" | ${SHASUM} --check - | |
213 | ||
214 | ASM_TREE_JAR=${JCOV_DEPS_DIR}/asm-tree-6.2.jar | |
215 | ASM_TREE_JAR_CHECKSUM='61570e046111559f38d4e0e580c005f75988c0a6' | |
216 | WGet ${MAVEN_REPO_URL}/org/ow2/asm/asm-tree/6.2/asm-tree-6.2.jar ${ASM_TREE_JAR} | |
217 | echo "${ASM_TREE_JAR_CHECKSUM} ${ASM_TREE_JAR}" | ${SHASUM} --check - | |
218 | ||
219 | ASM_UTIL_JAR=${JCOV_DEPS_DIR}/asm-utils-6.2.jar | |
220 | ASM_UTIL_JAR_CHECKSUM='a9690730f92cc79eeadc20e400ebb41eccce10b1' | |
221 | WGet ${MAVEN_REPO_URL}/org/ow2/asm/asm-util/6.2/asm-util-6.2.jar ${ASM_UTIL_JAR} | |
222 | echo "${ASM_UTIL_JAR_CHECKSUM} ${ASM_UTIL_JAR}" | ${SHASUM} --check - | |
223 | ||
224 | # Build jcov | |
225 | JCOV_SRC_ZIP=${JCOV_BUILD_DIR}/source.zip | |
226 | WGet ${CODE_TOOLS_URL}/jcov/archive/${JCOV_VERSION}.zip ${JCOV_SRC_ZIP} | |
227 | ${UNZIP} ${UNZIP_OPTS} -d ${JCOV_BUILD_DIR} ${JCOV_SRC_ZIP} | |
228 | ||
229 | if [ "${JCOV_VERSION}" = "tip" ]; then | |
230 | JCOV_VERSION=`cd ${JCOV_BUILD_DIR} ; ls -d jcov-* | sed -e 's/jcov-//'` | |
231 | fi | |
232 | ||
233 | JCOV_SRC=${JCOV_BUILD_DIR}/jcov-${JCOV_VERSION} | |
234 | JCOV_DIST=${JCOV_BUILD_DIR}/build | |
235 | ( cd ${JCOV_SRC}/build | |
236 | ${ANT} -Dresult.dir=`native_path ${JCOV_DIST}` \ | |
237 | -Dasm.jar=`native_path ${ASM_JAR}` \ | |
238 | -Dasm.checksum=${ASM_JAR_CHECKSUM} \ | |
239 | -Dasm.tree.jar=`native_path ${ASM_TREE_JAR}` \ | |
240 | -Dasm.tree.checksum=${ASM_TREE_JAR_CHECKSUM} \ | |
241 | -Dasm.util.jar=`native_path ${ASM_UTIL_JAR}` \ | |
242 | -Dasm.util.checksum=${ASM_UTIL_JAR_CHECKSUM} \ | |
243 | -Djavatestjar=`native_path ${JAVATEST_JAR}` \ | |
244 | -Dverify.strict= \ | |
245 | -f `native_path ${JCOV_SRC}/build/build.xml` | |
246 | ) | |
247 | ||
248 | JCOV_JAR=${JCOV_DIST}/jcov_3.0/jcov.jar | |
249 | JCOV_NETWORK_SAVER_JAR=${JCOV_DIST}/jcov_3.0/jcov_network_saver.jar | |
250 | JCOV_LICENSE=${JCOV_SRC}/LICENSE | |
251 | ||
252 | # JTREG | |
253 | ####### | |
254 | ||
255 | # Get jtreg dependencies | |
256 | JTREG_DEPS_DIR=${BUILD_DIR}/deps | |
257 | mkdir -p ${JTREG_DEPS_DIR} | |
258 | ||
259 | ## JUnit | |
260 | JUNIT_DEPS_DIR=${JTREG_DEPS_DIR}/junit | |
261 | mkdir -p ${JUNIT_DEPS_DIR} | |
262 | ||
263 | JUNIT_JAR=${JUNIT_DEPS_DIR}/junit-4.10.jar | |
264 | WGet ${MAVEN_REPO_URL}/junit/junit/4.10/junit-4.10.jar ${JUNIT_JAR} | |
265 | echo "e4f1766ce7404a08f45d859fb9c226fc9e41a861 ${JUNIT_JAR}" | ${SHASUM} --check - | |
266 | ||
267 | ${UNZIP} ${UNZIP_OPTS} ${JUNIT_JAR} LICENSE.txt -d ${JUNIT_DEPS_DIR} | |
268 | JUNIT_LICENSE=${JUNIT_DEPS_DIR}/LICENSE.txt | |
269 | ||
270 | ## TestNG | |
271 | TESTNG_DEPS_DIR=${JTREG_DEPS_DIR}/testng | |
272 | mkdir -p ${TESTNG_DEPS_DIR} | |
273 | ||
274 | TESTNG_JAR=${TESTNG_DEPS_DIR}/testng-6.9.5.jar | |
275 | WGet ${MAVEN_REPO_URL}/org/testng/testng/6.9.5/testng-6.9.5.jar ${TESTNG_JAR} | |
276 | echo "5d12ea207fc47c3f341a3f8ecc88a3eac396a777 ${TESTNG_JAR}" | ${SHASUM} --check - | |
277 | ||
278 | TESTNG_LICENSE=${TESTNG_DEPS_DIR}/LICENSE.txt | |
279 | WGet https://raw.githubusercontent.com/cbeust/testng/testng-6.9.5/LICENSE.txt ${TESTNG_LICENSE} | |
280 | ||
281 | JCOMMANDER_JAR=${TESTNG_DEPS_DIR}/jcommander-1.72.jar | |
282 | WGet ${MAVEN_REPO_URL}/com/beust/jcommander/1.72/jcommander-1.72.jar ${JCOMMANDER_JAR} | |
283 | echo "6375e521c1e11d6563d4f25a07ce124ccf8cd171 ${JCOMMANDER_JAR}" | ${SHASUM} --check - | |
284 | ||
285 | ||
286 | ## Set version and build numbers to the latest tagged version by default | |
287 | TAG_INFO=`get_tag_info` | |
288 | if [ -z ${BUILD_NUMBER:-} ]; then | |
289 | BUILD_NUMBER=`echo $TAG_INFO | sed 's/jtreg\([0-9]\.[0-9]\)-\(b[0-9]*\).*/\2/'` | |
290 | fi | |
291 | if [ -z ${BUILD_VERSION:-} ]; then | |
292 | BUILD_VERSION=`echo $TAG_INFO | sed 's/jtreg\([0-9]\.[0-9]\)-\(b[0-9]*\).*/\1/'` | |
293 | fi | |
294 | ||
295 | # Build jtreg | |
296 | cd ${ROOT}/make | |
297 | make JUNIT_JAR=`mixed_path ${JUNIT_JAR}` \ | |
298 | JUNIT_LICENSE=${JUNIT_LICENSE} \ | |
299 | TESTNG_JAR=`mixed_path ${TESTNG_JAR}` \ | |
300 | TESTNG_LICENSE=${TESTNG_LICENSE} \ | |
301 | JCOMMANDER_JAR=${JCOMMANDER_JAR} \ | |
302 | ANT=${ANT} \ | |
303 | ANT_JAR=`mixed_path ${ANT_JAR}` \ | |
304 | JCOV_JAR=${JCOV_JAR} \ | |
305 | JCOV_LICENSE=${JCOV_LICENSE} \ | |
306 | JCOV_NETWORK_SAVER_JAR=${JCOV_NETWORK_SAVER_JAR} \ | |
307 | JAVATEST_JAR=`mixed_path ${JAVATEST_JAR}` \ | |
308 | JTHARNESS_LICENSE=${JTHARNESS_LICENSE} \ | |
309 | JTHARNESS_COPYRIGHT=${JTHARNESS_COPYRIGHT} \ | |
310 | ASMTOOLS_JAR=${ASMTOOLS_JAR} \ | |
311 | ASMTOOLS_LICENSE=${ASMTOOLS_LICENSE} \ | |
312 | BUILD_VERSION=${BUILD_VERSION} \ | |
313 | BUILD_MILESTONE=${BUILD_MILESTONE:=dev} \ | |
314 | BUILD_NUMBER=${BUILD_NUMBER} \ | |
315 | JDKHOME=$JAVA_HOME \ | |
316 | ${MAKE_ARGS:-} |
86 | 86 | native_path() { |
87 | 87 | check_arguments "${FUNCNAME}" 1 $# |
88 | 88 | |
89 | if [ $CYGWIN -eq 1 ]; then echo $(cygpath -w $1); else echo "$1"; fi | |
89 | if [ $CYGWIN_OR_MSYS -eq 1 ]; then echo $(cygpath -w $1); else echo "$1"; fi | |
90 | 90 | } |
91 | 91 | |
92 | 92 | mixed_path() { |
93 | 93 | check_arguments "${FUNCNAME}" 1 $# |
94 | 94 | |
95 | if [ $CYGWIN -eq 1 ]; then echo $(cygpath -m $1); else echo "$1"; fi | |
95 | if [ $CYGWIN_OR_MSYS -eq 1 ]; then echo $(cygpath -m $1); else echo "$1"; fi | |
96 | 96 | } |
97 | 97 | |
98 | 98 | ## |
330 | 330 | |
331 | 331 | setup_shasum |
332 | 332 | |
333 | case $(uname) in CYGWIN*) CYGWIN=1 ;; *) CYGWIN=0 ;; esac | |
333 | ## | |
334 | # Support for Cygwin and MSYS2 (which may identify as MSYS, MINGW32 or MINGW64 (the default)) | |
335 | # | |
336 | case $(uname) in CYGWIN*|MSYS*|MINGW*) CYGWIN_OR_MSYS=1 ;; *) CYGWIN_OR_MSYS=0 ;; esac | |
337 | info "CYGWIN_OR_MSYS=$CYGWIN_OR_MSYS" |
22 | 22 | # questions. |
23 | 23 | # |
24 | 24 | |
25 | JTREG_VERSION=6 | |
25 | JTREG_VERSION=6.1 | |
26 | 26 | |
27 | 27 | DEFAULT_ANT_VERSION=1.10.8 |
28 | 28 | DEFAULT_ANT_ARCHIVE_CHECKSUM=dbe187ce2963f9df8a67de8aaff3b0a437d06978 |
925 | 925 | JCOV_JAR="${JCOV_JAR}" \ |
926 | 926 | JCOV_LICENSE="${JCOV_LICENSE}" \ |
927 | 927 | JCOV_NETWORK_SAVER_JAR="${JCOV_NETWORK_SAVER_JAR}" \ |
928 | JDKHOME="${JAVA_HOME}" \ | |
928 | JDKHOME="$(mixed_path ${JAVA_HOME})" \ | |
929 | 929 | JTHARNESS_COPYRIGHT="${JTHARNESS_COPYRIGHT}" \ |
930 | 930 | JTHARNESS_LICENSE="${JTHARNESS_LICENSE}" \ |
931 | 931 | JUNIT_JAR="$(mixed_path "${JUNIT_JAR}")" \ |
0 | #!/bin/sh | |
1 | ||
2 | # | |
3 | # Copyright (c) 2003, 2008, 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. Oracle designates this | |
9 | # particular file as subject to the "Classpath" exception as provided | |
10 | # by Oracle in the LICENSE file that accompanied this code. | |
11 | # | |
12 | # This code is distributed in the hope that it will be useful, but WITHOUT | |
13 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | # version 2 for more details (a copy is included in the LICENSE file that | |
16 | # accompanied this code). | |
17 | # | |
18 | # You should have received a copy of the GNU General Public License version | |
19 | # 2 along with this work; if not, write to the Free Software Foundation, | |
20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
21 | # | |
22 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
23 | # or visit www.oracle.com if you need additional information or have any | |
24 | # questions. | |
25 | # | |
26 | ||
27 | # display.sh [-kill] | |
28 | # | |
29 | # A wrapper around optional use of vncserver. | |
30 | # | |
31 | # If available and enabled, a vnc server will be started and its display | |
32 | # name returned. Otherwise $DISPLAY or a default will be returned. | |
33 | # If the -kill option is given the vnc server on $DISPLAY will be killed. | |
34 | # | |
35 | # Set environment variable VNC to false|off|no|0 to disable VNC; | |
36 | # this is useful if you need to debug GUI targets | |
37 | ||
38 | #echo debug: VNC=$VNC 1>&2 | |
39 | #echo debug: DISPLAY=$DISPLAY 1>&2 | |
40 | ||
41 | # setup VNC if enabled | |
42 | case "${VNC:-1}" in | |
43 | false|off|no|0 ) | |
44 | VNC=0 | |
45 | ;; | |
46 | * ) if [ -f $HOME/.vnc/passwd ]; then | |
47 | # put VNC_HOME on front of path, if set | |
48 | # otherwise, try and find vncserver if not on PATH | |
49 | if [ -n "$VNC_HOME" ]; then | |
50 | PATH=$VNC_HOME:$PATH | |
51 | export PATH | |
52 | elif [ -z "`which vncserver`" ]; then | |
53 | if [ -f /usr/dist/exe/vncserver ]; then | |
54 | PATH=/usr/dist/exe:$PATH | |
55 | export PATH | |
56 | fi | |
57 | fi | |
58 | # final check | |
59 | if [ -n "`which vncserver`" ]; then | |
60 | VNC=1 | |
61 | else | |
62 | VNC=0 | |
63 | fi | |
64 | else | |
65 | # user does not have VNC password set | |
66 | VNC=0 | |
67 | fi | |
68 | ;; | |
69 | esac | |
70 | ||
71 | # use VNC if enabled and available | |
72 | if [ $VNC = 1 ]; then | |
73 | if [ "$1" = "-kill" ]; then | |
74 | vncserver -kill $DISPLAY | |
75 | else | |
76 | # echo debug: starting VNC 1>&2 | |
77 | VNC_SERVERLOG=${BUILDDIR:-../build}/vncserver.log | |
78 | vncserver 2>&1 | tee $VNC_SERVERLOG 1>&2 | |
79 | grep 'New .* desktop is' $VNC_SERVERLOG | \ | |
80 | sed -e 's/^.*desktop is \(.*\)/\1/' | |
81 | fi | |
82 | else | |
83 | if [ "$1" != "-kill" ]; then | |
84 | echo ${DISPLAY:-`uname -n`:0.0} | |
85 | fi | |
86 | fi | |
87 |
62 | 62 | ### The following files are for the jtreg and jtdiff tools |
63 | 63 | |
64 | 64 | JAVAFILES.com.sun.javatest.regtest-tools := \ |
65 | $(shell $(FIND) $(JAVADIR)/com/sun/javatest/regtest -name agent -prune -o -name \*.java -print ) \ | |
66 | $(JAVADIR)/java/lang/JTRegModuleHelper.java | |
65 | $(shell $(FIND) $(JAVADIR)/com/sun/javatest/regtest -name agent -prune -o -name \*.java -print ) | |
67 | 66 | |
68 | 67 | $(BUILDDIR)/classes.com.sun.javatest.regtest.ok: \ |
69 | 68 | $(JAVAFILES.com.sun.javatest.regtest-tools) \ |
76 | 75 | echo "classes built at `date`" > $@ |
77 | 76 | |
78 | 77 | TARGETS.com.sun.javatest.regtest += $(BUILDDIR)/classes.com.sun.javatest.regtest.ok |
78 | ||
79 | ||
80 | JAVAFILES.java.lang := \ | |
81 | $(JAVADIR)/java/lang/JTRegModuleHelper.java | |
82 | ||
83 | $(BUILDDIR)/classes.java.lang.ok: \ | |
84 | $(JAVAFILES.java.lang) | |
85 | CLASSPATH= \ | |
86 | $(REGTEST_TOOL_JAVAC) $(REGTEST_TOOL_JAVAC_OPTIONS) $(REGTEST_TOOL_PATCH_JAVA_BASE_OPTIONS) \ | |
87 | -d $(CLASSDIR) \ | |
88 | -encoding ISO8859-1 \ | |
89 | $(JAVAFILES.java.lang) | |
90 | echo "classes built at `date`" > $@ | |
91 | ||
92 | TARGETS.com.sun.javatest.regtest += $(BUILDDIR)/classes.java.lang.ok | |
79 | 93 | |
80 | 94 | |
81 | 95 | #---------------------------------------------------------------------- |
0 | 0 | plugins { |
1 | 1 | id 'java' |
2 | id 'org.jetbrains.intellij' version '0.7.3' | |
2 | id 'org.jetbrains.intellij' version '1.0' | |
3 | 3 | } |
4 | 4 | |
5 | 5 | def jtregLib = jtregHome + File.separator + "lib" + File.separator + "jtreg.jar" |
25 | 25 | |
26 | 26 | // See https://github.com/JetBrains/gradle-intellij-plugin/ |
27 | 27 | intellij { |
28 | version intellijVersion | |
29 | 28 | plugins = ['java', 'AntSupport', 'TestNG-J'] |
30 | 29 | } |
31 | 30 | |
32 | 31 | patchPluginXml { |
33 | changeNotes notes | |
32 | changeNotes = notes | |
33 | sinceBuild = minBuild | |
34 | untilBuild = '' | |
34 | 35 | } |
0 | 0 | jtregHome = /path/to/jtreg |
1 | intellijVersion = 2021.1.1 | |
2 | pluginVersion = 1.12 | |
1 | minBuild = 211 | |
2 | pluginVersion = 1.13 | |
3 | 3 | javaLevel = 11 |
4 | 4 | notes = <ul>\ |
5 | <li>Fix compatibility with 2020.3</li>\ | |
5 | <li>Fix compatibility with 2021.2</li>\ | |
6 | 6 | </ul> |
7 | 7 | <option name="JAVA_COMMENT" value="true" /> |
8 | 8 | </context> |
9 | 9 | </template> |
10 | <template name="@test /nodynamiccopyright/" value="@test /nodynamioccopyright/ * @bug $BUG_ID$ * @summary $BUG_SUMMARY$ * $JTREG_ACTION$/fail/ref=$GOLDEN_NAME$ -XDrawDiagnostics $FILE_NAME$" description="jtreg header (negative test)" toReformat="false" toShortenFQNames="true"> | |
10 | <template name="@test /nodynamiccopyright/" value="@test /nodynamiccopyright/ * @bug $BUG_ID$ * @summary $BUG_SUMMARY$ * $JTREG_ACTION$/fail/ref=$GOLDEN_NAME$ -XDrawDiagnostics $FILE_NAME$" description="jtreg header (negative test)" toReformat="false" toShortenFQNames="true"> | |
11 | 11 | <variable name="BUG_ID" expression="groovyScript("_1 ==~ /T\\d{7}/ ? _1.substring(1).take(7) : 'NNNNNNN'", fileNameWithoutExtension())" defaultValue="NNNNNNN" alwaysStopAt="true" /> |
12 | 12 | <variable name="BUG_SUMMARY" expression=""Bug summary"" defaultValue="" alwaysStopAt="true" /> |
13 | 13 | <variable name="JTREG_ACTION" expression=""@compile"" defaultValue="" alwaysStopAt="true" /> |
0 | 0 | /* |
1 | * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. | |
1 | * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. | |
2 | 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 | 3 | * |
4 | 4 | * This code is free software; you can redistribute it and/or modify it |
74 | 74 | private void writeHead() throws IOException { |
75 | 75 | for (int i = 0; i < size; i++) { |
76 | 76 | int[] c = testCounts.get(i); |
77 | int p = c[Status.PASSED]; | |
78 | int f = c[Status.FAILED]; | |
79 | int e = c[Status.ERROR]; | |
80 | int nr = c[Status.NOT_RUN]; | |
77 | int passed = c[Status.PASSED]; | |
78 | int failed = c[Status.FAILED]; | |
79 | int error = c[Status.ERROR]; | |
80 | int notRun = c[Status.NOT_RUN]; | |
81 | 81 | writeI18N("simple.set", i, table.getColumnName(i)); |
82 | 82 | print(" "); |
83 | 83 | writeI18N("simple.counts", |
84 | new Integer(p), | |
85 | new Integer((p > 0) && (f + e + nr > 0) ? 1 : 0), | |
86 | new Integer(f), | |
87 | new Integer((f > 0) && (e + nr > 0) ? 1 : 0), | |
88 | new Integer(e), | |
89 | new Integer((e > 0) && (nr > 0) ? 1 : 0), | |
90 | new Integer(nr)); | |
84 | passed, | |
85 | (passed > 0) && (failed + error + notRun > 0) ? 1 : 0, | |
86 | failed, | |
87 | (failed > 0) && (error + notRun > 0) ? 1 : 0, | |
88 | error, | |
89 | (error > 0) && (notRun > 0) ? 1 : 0, | |
90 | notRun); | |
91 | 91 | println(); |
92 | 92 | } |
93 | 93 | } |
256 | 256 | ((RegressionSecurityManager) sc).setAllowSetIO(prev); |
257 | 257 | } else { |
258 | 258 | //return Status.error(MAIN_SECMGR_BAD); |
259 | System.setOut(out); | |
260 | System.setErr(err); | |
259 | 261 | } |
260 | 262 | } |
261 | 263 | return passed("OK"); |
29 | 29 | |
30 | 30 | public class RegressionSecurityManager extends JavaTestSecurityManager { |
31 | 31 | /** |
32 | * Try to install a copy of this security manager. If another security manager is | |
33 | * already installed, the install will fail; a warning message will be written to | |
34 | * the console if the previously installed security manager is not a subtype of | |
35 | * com.sun.javatest.JavaTestSecurityManager. | |
32 | * Try to install a copy of this security manager, up to but not including JDK 18. | |
33 | * If another security manager is already installed, the install will fail; | |
34 | * a warning message will be written to the console if the previously installed | |
35 | * security manager is not a subtype of com.sun.javatest.JavaTestSecurityManager. | |
36 | 36 | * The install can be suppressed by setting the system property |
37 | 37 | * "javatest.security.noSecurityManager" to true. |
38 | 38 | */ |
39 | 39 | public static void install() { |
40 | String sv = System.getProperty("java.specification.version"); | |
41 | if (sv != null && sv.matches("[0-9]+")) { // older versions are 1.N | |
42 | int v = Integer.parseInt(sv); | |
43 | if (v >= 18) { | |
44 | // Do not install any security manager for JDK 18 or later; | |
45 | // see JEP 411: Deprecate the Security Manager for Removal | |
46 | return; | |
47 | } | |
48 | } | |
49 | ||
40 | 50 | try { |
41 | 51 | // install our own permissive security manager, to prevent anyone else |
42 | 52 | // installing a less permissive one. |
332 | 332 | if (nativeCode && script.getNativeDir() == null) |
333 | 333 | return error(MAIN_NO_NATIVES); |
334 | 334 | |
335 | startAction(true); | |
336 | ||
337 | 335 | if (script.isCheck()) { |
336 | startAction(true); | |
338 | 337 | status = passed(CHECK_PASS); |
338 | endAction(status); | |
339 | 339 | } else { |
340 | 340 | Lock lock = script.getLockIfRequired(); |
341 | 341 | if (lock != null) lock.lock(); |
342 | ||
343 | // Start action after the lock is taken to ensure correct "elapsed time". | |
344 | startAction(true); | |
345 | ||
342 | 346 | try { |
343 | 347 | switch (!othervmOverrideReasons.isEmpty() ? ExecMode.OTHERVM : script.getExecMode()) { |
344 | 348 | case AGENTVM: |
353 | 357 | throw new AssertionError(); |
354 | 358 | } |
355 | 359 | } finally { |
360 | // End action before releasing the lock. | |
361 | endAction(status); | |
356 | 362 | if (lock != null) lock.unlock(); |
357 | 363 | } |
358 | 364 | } |
359 | 365 | |
360 | endAction(status); | |
361 | 366 | return status; |
362 | 367 | } // run() |
363 | 368 |
0 | 0 | /* |
1 | * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. | |
1 | * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. | |
2 | 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 | 3 | * |
4 | 4 | * This code is free software; you can redistribute it and/or modify it |
32 | 32 | * <i>This code is temporary, and should eventually be replaced by |
33 | 33 | * injecting code into the relevant modules.</i> |
34 | 34 | */ |
35 | public class JTRegModuleHelper { | |
35 | public final class JTRegModuleHelper { | |
36 | ||
37 | // Non-instantiable helper | |
38 | private JTRegModuleHelper() { | |
39 | } | |
40 | ||
36 | 41 | /* |
37 | 42 | * Use reflection to simulate: |
38 | 43 | * module.implAddExports(packageName, targetModule); |
1072 | 1072 | identification it may be useful to put information such as SCCS ID keywords after the `@test` tag. |
1073 | 1073 | |
1074 | 1074 | While not part of the tag specification, some tests use the |
1075 | string "`/nodynamiccopyright`" after `@test` | |
1075 | string "`/nodynamiccopyright/`" after `@test` | |
1076 | 1076 | to indicate that that the file should not be subject to automated |
1077 | 1077 | copyright processing that might affect the operation of the test, |
1078 | 1078 | for example, by affecting the line numbers of the test source code. |
65 | 65 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
66 | 66 | -jdk:$(JDKHOME) \ |
67 | 67 | -agentvm -allowSetSecurityManager:no \ |
68 | $(TESTDIR)/SecurityManager \ | |
68 | $(TESTDIR)/SecurityManager/pass \ | |
69 | $(TESTDIR)/SecurityManager/error \ | |
69 | 70 | 2>&1 | tee $(@:%.ok=%)/out.txt |
70 | 71 | grep "Test results: failed: 5" $(@:%.ok=%)/out.txt |
71 | 72 | echo "test passed at `date`" > $@ |
88 | 89 | TESTS.jtreg += \ |
89 | 90 | $(BUILDDIR)/SecurityManagerTest_othervm.ok |
90 | 91 | |
92 | #---------------------------------------------------------------------- | |
93 | ||
94 | $(BUILDDIR)/SecurityManagerTest_8.ok \ | |
95 | $(BUILDDIR)/SecurityManagerTest_14.ok \ | |
96 | $(BUILDDIR)/SecurityManagerTest_18.ok: \ | |
97 | $(JTREG_IMAGEDIR)/lib/jtreg.jar \ | |
98 | $(JTREG_IMAGEDIR)/bin/jtreg | |
99 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ | |
100 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ | |
101 | -jdk:$(JDK$(@:$(BUILDDIR)/SecurityManagerTest_%.ok=%)HOME) \ | |
102 | -agentvm \ | |
103 | $(TESTDIR)/SecurityManager/ShowSecurityManager.java | |
104 | case "$(@:$(BUILDDIR)/SecurityManagerTest_%.ok=%)" in \ | |
105 | 18 ) $(GREP) "SM=null" \ | |
106 | $(@:%.ok=%)/work/ShowSecurityManager.jtr ;; \ | |
107 | * ) $(GREP) "SM=com.sun.javatest.regtest.agent.RegressionSecurityManager" \ | |
108 | $(@:%.ok=%)/work/ShowSecurityManager.jtr ;; \ | |
109 | esac | |
110 | if $(GREP) "WARNING: System::setSecurityManager has been called" \ | |
111 | $(@:%.ok=%)/work/ShowSecurityManager.jtr ; then \ | |
112 | echo "error: warning message found" ; \ | |
113 | fi | |
114 | echo "test passed at `date`" > $@ | |
115 | ||
116 | ifdef JDK8HOME | |
117 | TESTS.jtreg += \ | |
118 | $(BUILDDIR)/SecurityManagerTest_8.ok | |
119 | endif | |
120 | ||
121 | ifdef JDK14HOME | |
122 | TESTS.jtreg += \ | |
123 | $(BUILDDIR)/SecurityManagerTest_14.ok | |
124 | endif | |
125 | ||
126 | ifdef JDK18HOME | |
127 | TESTS.jtreg += \ | |
128 | $(BUILDDIR)/SecurityManagerTest_18.ok | |
129 | endif⏎ |
0 | /* | |
1 | * Copyright (c) 2010, 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 | /* | |
24 | * @test | |
25 | * @run main ShowSecurityManager | |
26 | */ | |
27 | ||
28 | public class ShowSecurityManager { | |
29 | public static void main(String... args) { | |
30 | System.err.println("SM=" + System.getSecurityManager()); | |
31 | } | |
32 | }⏎ |
105 | 105 | $(JTREG_IMAGEDIR)/lib/testng.jar \ |
106 | 106 | $(TESTDIR)/basic/Basic.java \ |
107 | 107 | $(BUILDDIR)/i18n.com.sun.javatest.regtest.ok \ |
108 | $(BASIC.files) \ | |
109 | display.sh | |
108 | $(BASIC.files) | |
110 | 109 | $(RM) $(@:%.ok=%/work) $(@:%.ok=%/report) |
111 | 110 | $(MKDIR) -p $(@:%.ok=%/work/scratch) $(@:%.ok=%/report) $(BUILDDIR)/basic/classes |
112 | 111 | CLASSPATH="$(CLASSDIR)$(PS)$(JAVADIR)$(PS)$(JAVATEST_JAR)" \ |
113 | 112 | $(JDKJAVAC) -Xlint -Werror -encoding ISO8859-1 -d $(BUILDDIR)/basic/classes $(TESTDIR)/basic/Basic.java |
114 | DISPLAY=`BUILDDIR=$(BUILDDIR) sh display.sh` export DISPLAY ; \ | |
115 | trap "BUILDDIR=$(BUILDDIR) sh `pwd`/display.sh -kill" 0 ; \ | |
116 | 113 | cd $(@:%.ok=%/work/scratch) ; \ |
117 | 114 | $(JDKJAVA) \ |
118 | 115 | -cp "../../../basic/classes$(PS)$(ABS_JTREG_IMAGEJARDIR)/jtreg.jar" \ |
133 | 130 | || (cat ../../log ; exit 1) |
134 | 131 | echo $@ passed at `date` > $@ |
135 | 132 | |
133 | ifndef HEADLESS | |
136 | 134 | INITIAL_TESTS += \ |
137 | 135 | $(BUILDDIR)/Basic.othervm.ok \ |
138 | 136 | $(BUILDDIR)/Basic.agentvm.ok |
137 | endif | |
139 | 138 |
40 | 40 | $(GREP) -s 'Test results: passed: 92; failed: 44; error: 87' $(@:%.ok=%.jt.log) > /dev/null |
41 | 41 | echo $@ passed at `date` > $@ |
42 | 42 | |
43 | ifndef HEADLESS | |
43 | 44 | TESTS.jtreg += $(BUILDDIR)/ReportOnlyTest.ok |
45 | endif | |
44 | 46 |
24 | 24 | |
25 | 25 | UCD_FILES := $(shell find $(TESTDIR)/classIsolation -type f ) |
26 | 26 | |
27 | # Up until jtreg 4.2 b08, class files were placed in a shared classes directory. | |
28 | # When enabled in jtreg 4.2 b08 or later, class files are placed in an unshared test-specific directory | |
29 | # See Locations constructor, local variable useUniqueClassDir | |
30 | ||
27 | 31 | $(BUILDDIR)/ClassIsolation.disable.b07.ok: $(UCD_FILES) \ |
28 | 32 | $(JTREG_IMAGEDIR)/lib/javatest.jar \ |
29 | 33 | $(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
37 | 41 | -w $(@:%.ok=%)/work \ |
38 | 42 | -r $(@:%.ok=%)/report \ |
39 | 43 | $(TESTDIR)/classIsolation/disable |
40 | files=`$(FIND) $(@:%.ok=%)/work -name \*.class | grep 'Test.\.d'` ; \ | |
44 | files=`$(FIND) $(@:%.ok=%)/work -name patches -prune -o -name \*.class -print | grep 'Test.\.d'` ; \ | |
41 | 45 | if [ -n "$$files" ]; then \ |
42 | 46 | echo "Unexpected files found:" ; \ |
43 | 47 | for f in $$files ; do echo $$f ; done ; \ |
59 | 63 | -w $(@:%.ok=%)/work \ |
60 | 64 | -r $(@:%.ok=%)/report \ |
61 | 65 | $(TESTDIR)/classIsolation/disable |
62 | files=`$(FIND) $(@:%.ok=%)/work -name \*.class | grep 'Test.\.d'` ; \ | |
66 | files=`$(FIND) $(@:%.ok=%)/work -name patches -prune -o -name \*.class -print | grep 'Test.\.d'` ; \ | |
63 | 67 | if [ -n "$$files" ]; then \ |
64 | 68 | echo "Unexpected files found:" ; \ |
65 | 69 | for f in $$files ; do echo $$f ; done ; \ |
80 | 84 | -w $(@:%.ok=%)/work \ |
81 | 85 | -r $(@:%.ok=%)/report \ |
82 | 86 | $(TESTDIR)/classIsolation/default |
83 | files=`$(FIND) $(@:%.ok=%)/work -name \*.class | grep 'Test.\.d'` ; \ | |
87 | files=`$(FIND) $(@:%.ok=%)/work -name patches -prune -o -name \*.class -print | grep 'Test.\.d'` ; \ | |
84 | 88 | if [ -n "$$files" ]; then \ |
85 | 89 | echo "Unexpected files found:" ; \ |
86 | 90 | for f in $$files ; do echo $$f ; done ; \ |
101 | 105 | -w $(@:%.ok=%)/work \ |
102 | 106 | -r $(@:%.ok=%)/report \ |
103 | 107 | $(TESTDIR)/classIsolation/enable |
104 | files=`$(FIND) $(@:%.ok=%)/work -name \*.class | grep -v 'Test.\.d'` ; \ | |
108 | files=`$(FIND) $(@:%.ok=%)/work -name patches -prune -o -name \*.class -print | grep -v 'Test.\.d'` ; \ | |
105 | 109 | if [ -n "$$files" ]; then \ |
106 | 110 | echo "Unexpected files found:" ; \ |
107 | 111 | for f in $$files ; do echo $$f ; done ; \ |
28 | 28 | $(JTREG_IMAGEDIR)/lib/javatest.jar \ |
29 | 29 | $(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
30 | 30 | $(JTREG_IMAGE_JAVAHELP_JAR) \ |
31 | $(JTREG_IMAGEDIR)/bin/jtreg \ | |
32 | display.sh | |
31 | $(JTREG_IMAGEDIR)/bin/jtreg | |
33 | 32 | $(RM) $(@:%.ok=%) |
34 | 33 | $(MKDIR) $(@:%.ok=%) |
35 | 34 | ( echo "testRoot=`cd $(TESTDIR)/env ; pwd`" ; \ |
40 | 39 | echo "test.java.opts="; \ |
41 | 40 | echo "test.jdk=$(JDK6HOME)"; \ |
42 | 41 | echo "compile.jdk=$(JDK6HOME)" ) > $(@:%.ok=%/ref.properties) |
43 | DISPLAY=`BUILDDIR=$(BUILDDIR) sh display.sh` export DISPLAY ; \ | |
44 | trap "BUILDDIR=$(BUILDDIR) sh `pwd`/display.sh -kill" 0 ; \ | |
45 | 42 | JT_JAVA=$(JDKHOME) $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
46 | 43 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
47 | 44 | -jdk:$(JDK6HOME) \ |
56 | 53 | $(JTREG_IMAGEDIR)/lib/javatest.jar \ |
57 | 54 | $(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
58 | 55 | $(JTREG_IMAGE_JAVAHELP_JAR) \ |
59 | $(JTREG_IMAGEDIR)/bin/jtreg \ | |
60 | display.sh | |
56 | $(JTREG_IMAGEDIR)/bin/jtreg | |
61 | 57 | $(RM) $(@:%.ok=%) |
62 | 58 | $(MKDIR) $(@:%.ok=%) |
63 | 59 | ( echo "testRoot=`cd $(TESTDIR)/env ; pwd`" ; \ |
68 | 64 | echo "test.java.opts=-DJAVA_OPT=java_opt"; \ |
69 | 65 | echo "test.jdk=$(JDK7HOME)"; \ |
70 | 66 | echo "compile.jdk=$(JDK6HOME)" ) > $(@:%.ok=%/ref.properties) |
71 | DISPLAY=`BUILDDIR=$(BUILDDIR) sh display.sh` export DISPLAY ; \ | |
72 | trap "BUILDDIR=$(BUILDDIR) sh `pwd`/display.sh -kill" 0 ; \ | |
73 | 67 | JT_JAVA=$(JDKHOME) $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
74 | 68 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
75 | 69 | -compilejdk:$(JDK6HOME) \ |
88 | 82 | ifneq ($(OS_NAME), windows) |
89 | 83 | ifdef JDK6HOME |
90 | 84 | ifdef JDK7HOME |
85 | ifndef HEADLESS | |
91 | 86 | TESTS.jtreg += \ |
92 | 87 | $(BUILDDIR)/EnvTest.simple.ok \ |
93 | 88 | $(BUILDDIR)/EnvTest.full.ok |
94 | 89 | endif |
95 | 90 | endif |
96 | 91 | endif |
92 | endif |
34 | 34 | JTREG_USE_AGENTVM_FOR_SAMEVM=false \ |
35 | 35 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
36 | 36 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
37 | -jdk:$(JDKHOME) \ | |
37 | -jdk:$(JDK8HOME) \ | |
38 | 38 | $(@:$(BUILDDIR)/javac/%.ok=-%) \ |
39 | 39 | $(TESTDIR)/javac |
40 | 40 | echo "test passed at `date`" > $@ |
41 | 41 | |
42 | # test requires access to javac internals, so needs @modules tag to run on JDK 9 or later | |
43 | ifdef JDK8HOME | |
42 | 44 | TESTS.jtreg += \ |
43 | 45 | $(BUILDDIR)/javac/othervm.ok \ |
44 | 46 | $(BUILDDIR)/javac/agentvm.ok |
47 | endif | |
45 | 48 |
34 | 34 | JT_JAVA=$(JDK6HOME) \ |
35 | 35 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
36 | 36 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
37 | -jdk:$(JDK11HOME) \ | |
37 | -jdk:$(JDK1_1HOME) \ | |
38 | 38 | $(TESTDIR)/jdk11/ExecuteTest.java |
39 | 39 | echo "test passed at `date`" > $@ |
40 | 40 | |
47 | 47 | JT_JAVA=$(JDK6HOME) \ |
48 | 48 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
49 | 49 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
50 | -compilejdk:$(JDK11HOME) \ | |
50 | -compilejdk:$(JDK1_1HOME) \ | |
51 | 51 | -jdk:$(JDK6HOME) \ |
52 | 52 | $(TESTDIR)/jdk11/ExecuteTest.java |
53 | 53 | echo "test passed at `date`" > $@ |
54 | 54 | |
55 | ifneq ($(JDK11HOME),) | |
55 | ifdef JDK1_1HOME | |
56 | ifdef JDK6HOME | |
56 | 57 | TESTS.jtreg += \ |
57 | 58 | $(BUILDDIR)/JDK11Test.1.ok \ |
58 | 59 | $(BUILDDIR)/JDK11Test.2.ok |
59 | 60 | endif |
61 | endif | |
60 | 62 |
0 | /* | |
1 | * Copyright (c) 2020, 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 | /* | |
24 | * @test | |
25 | * @summary checks that user modules can be used as library classes by tests | |
26 | * @library /libs/usermods | |
27 | * @build lum1/* | |
28 | * @run main UseUserModAsLib | |
29 | * @run driver UseUserModAsLib | |
30 | */ | |
31 | ||
32 | public class UseUserModAsLib { | |
33 | public static void main(String[] args) { | |
34 | new lum1_p1.lum1_p1_C().run(); | |
35 | } | |
36 | } |
21 | 21 | */ |
22 | 22 | |
23 | 23 | module um1 { |
24 | requires testng; | |
24 | requires org.testng; | |
25 | 25 | exports um1_p1; |
26 | 26 | } |
21 | 21 | */ |
22 | 22 | |
23 | 23 | module um2 { |
24 | requires testng; | |
24 | requires org.testng; | |
25 | 25 | exports um2_p1; |
26 | 26 | } |
32 | 32 | $(RM) $(@:%.ok=%) ; $(MKDIR) $(@:%.ok=%) |
33 | 33 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
34 | 34 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
35 | -jdk:$(JDKHOME) \ | |
35 | -jdk:$(JDK8HOME) \ | |
36 | 36 | $(TESTDIR)/refIgnoreLines \ |
37 | 37 | > $(@:%.ok=%/jt.log) |
38 | 38 | echo "test passed at `date`" > $@ |
39 | 39 | |
40 | ifdef JDK8HOME | |
40 | 41 | TESTS.jtreg += $(BUILDDIR)/RefIgnoreLines_std.ok |
42 | endif | |
41 | 43 | |
42 | 44 | testRefIgnoreLines: $(BUILDDIR)/RefIgnoreLines_std.ok |
43 | 45 | |
51 | 53 | $(RM) $(@:%.ok=%) ; $(MKDIR) $(@:%.ok=%) |
52 | 54 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
53 | 55 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
54 | -jdk:$(JDKHOME) \ | |
56 | -jdk:$(JDK8HOME) \ | |
55 | 57 | -Xmx100m \ |
56 | 58 | $(TESTDIR)/refIgnoreLines \ |
57 | 59 | > $(@:%.ok=%/jt.log) |
58 | 60 | echo "test passed at `date`" > $@ |
59 | 61 | |
62 | ifdef JDK8HOME | |
60 | 63 | TESTS.jtreg += $(BUILDDIR)/RefIgnoreLines_Xmx.ok |
64 | endif | |
65 | ||
61 | 66 | testRefIgnoreLines: $(BUILDDIR)/RefIgnoreLines_Xmx.ok |
62 | 67 | |
63 | 68 | #------------------------------------------------------------ |
72 | 77 | $(@:$(BUILDDIR)/RefIgnoreLines_%_1.ok=%)=-Xmx100m \ |
73 | 78 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
74 | 79 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
75 | -jdk:$(JDKHOME) \ | |
80 | -jdk:$(JDK8HOME) \ | |
76 | 81 | -e:$(@:$(BUILDDIR)/RefIgnoreLines_%_1.ok=%) \ |
77 | 82 | $(TESTDIR)/refIgnoreLines \ |
78 | 83 | > $(@:%.ok=%/jt.log) |
79 | 84 | $(GREP) 'Ignoring line: Picked up' $(@:%.ok=%)/work/Test.jtr |
80 | 85 | echo "test passed at `date`" > $@ |
81 | 86 | |
87 | ifdef JDK8HOME | |
82 | 88 | TESTS.jtreg += \ |
83 | 89 | $(BUILDDIR)/RefIgnoreLines_JAVA_TOOL_OPTIONS_1.ok \ |
84 | 90 | $(BUILDDIR)/RefIgnoreLines__JAVA_OPTIONS_1.ok |
91 | endif | |
85 | 92 | |
86 | 93 | testRefIgnoreLines: \ |
87 | 94 | $(BUILDDIR)/RefIgnoreLines_JAVA_TOOL_OPTIONS_1.ok \ |
98 | 105 | $(RM) $(@:%.ok=%) ; $(MKDIR) $(@:%.ok=%) |
99 | 106 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
100 | 107 | -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ |
101 | -jdk:$(JDKHOME) \ | |
108 | -jdk:$(JDK8HOME) \ | |
102 | 109 | -e:$(@:$(BUILDDIR)/RefIgnoreLines_%_2.ok=%)=-Xmx100m \ |
103 | 110 | $(TESTDIR)/refIgnoreLines \ |
104 | 111 | > $(@:%.ok=%/jt.log) |
105 | 112 | $(GREP) 'Ignoring line: Picked up' $(@:%.ok=%)/work/Test.jtr |
106 | 113 | echo "test passed at `date`" > $@ |
107 | 114 | |
115 | ||
116 | ifdef JDK8HOME | |
108 | 117 | TESTS.jtreg += \ |
109 | 118 | $(BUILDDIR)/RefIgnoreLines_JAVA_TOOL_OPTIONS_2.ok \ |
110 | 119 | $(BUILDDIR)/RefIgnoreLines__JAVA_OPTIONS_2.ok |
120 | endif | |
111 | 121 | |
112 | 122 | testRefIgnoreLines: \ |
113 | 123 | $(BUILDDIR)/RefIgnoreLines_JAVA_TOOL_OPTIONS_2.ok \ |
31 | 31 | $(BUILDDIR)/RerunTest.agentvm.ok \ |
32 | 32 | $(BUILDDIR)/RerunTest.othervm.ok: \ |
33 | 33 | $(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
34 | $(JTREG_IMAGEDIR)/bin/jtreg \ | |
35 | display.sh | |
34 | $(JTREG_IMAGEDIR)/bin/jtreg | |
36 | 35 | $(RM) $(@:%.ok=%) ; $(MKDIR) $(@:%.ok=%) |
37 | DISPLAY=`BUILDDIR=$(BUILDDIR) sh display.sh` export DISPLAY ; \ | |
38 | trap "BUILDDIR=$(BUILDDIR) sh `pwd`/display.sh -kill" 0 ; \ | |
39 | 36 | unset GNOME_DESKTOP_SESSION_ID ; \ |
40 | 37 | unset XMODIFIERS ; \ |
41 | 38 | LANG=en_US.UTF-8 TZ=GMT+0.00 \ |
64 | 61 | -e "s|`cd $(JDK8HOME); pwd -P`|%JDKHOME%|g" \ |
65 | 62 | -e 's|$(BUILDDIR)|%BUILD%|g' \ |
66 | 63 | -e 's|$(ABSTOPDIR)|%WS%|g' \ |
64 | -e 's|%BUILD%.images.jtreg.lib.guice\.jar.||g' \ | |
65 | -e 's|%BUILD%.images.jtreg.lib.hamcrest\.jar.||g' \ | |
67 | 66 | -e 's|%BUILD%.images.jtreg.lib.jcommander\.jar.||g' \ |
68 | 67 | > $(@:%.ok=%)/out/$${i%.*}.out ; \ |
69 | 68 | diff -c $(TESTDIR)/rerun/$${i%.*}.$(@:$(BUILDDIR)/RerunTest.%.ok=%).out \ |
73 | 72 | |
74 | 73 | ifdef JDK8HOME |
75 | 74 | ifneq ($(OS_NAME), windows) |
75 | ifndef HEADLESS | |
76 | 76 | TESTS.jtreg += \ |
77 | 77 | $(BUILDDIR)/RerunTest.agentvm.ok \ |
78 | 78 | $(BUILDDIR)/RerunTest.othervm.ok |
79 | 79 | endif |
80 | 80 | endif |
81 | endif |
22 | 22 | # questions. |
23 | 23 | # |
24 | 24 | |
25 | # Tests use pre-module features, such as bootclasspath | |
26 | ||
25 | 27 | $(BUILDDIR)/RerunTest2.ok: \ |
26 | 28 | $(TESTDIR)/rerun2/RerunTest2.java \ |
27 | 29 | $(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
30 | 32 | $(JTREG_IMAGEDIR)/bin/jtreg |
31 | 33 | $(RM) $(@:%.ok=%) ; $(MKDIR) $(@:%.ok=%) |
32 | 34 | $(MKDIR) $(@:%.ok=%)/classes |
33 | $(JDKJAVAC) \ | |
35 | $(JDK8HOME)/bin/javac \ | |
34 | 36 | -d $(@:%.ok=%)/classes \ |
35 | 37 | -cp $(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
36 | 38 | -Xlint -Werror \ |
37 | 39 | $(TESTDIR)/rerun2/RerunTest2.java |
38 | cd $(@:%.ok=%) && $(JDKJAVA) \ | |
40 | cd $(@:%.ok=%) && $(JDK8HOME)/bin/java \ | |
39 | 41 | -classpath classes$(PS)$(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
40 | 42 | RerunTest2 \ |
41 | 43 | ../$(TESTDIR)/rerun2/test |
42 | 44 | echo "test passed at `date`" > $@ |
43 | 45 | |
46 | ifdef JDK8HOME | |
44 | 47 | ifneq ($(OS_NAME), windows) |
45 | 48 | TESTS.jtreg += \ |
46 | 49 | $(BUILDDIR)/RerunTest2.ok |
47 | 50 | endif |
51 | endif | |
48 | 52 | |
49 | 53 |
0 | # | |
1 | # Copyright (c) 1997, 2017, 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. Oracle designates this | |
7 | # particular file as subject to the "Classpath" exception as provided | |
8 | # by Oracle in the LICENSE file that accompanied this code. | |
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 | $(BUILDDIR)/TestSanityTest.ok: | |
26 | $(RM) $(@:%.ok=%) | |
27 | $(MKDIR) -p $(@:%.ok=%) | |
28 | $(FIND) $(TOPDIR)/make $(TOPDIR)/test -name \*.gmk | \ | |
29 | xargs $(GREP) -o 'JDK[1-9][0-9_]*HOME' | $(SED) -e 's/.*://' | $(SORT) -u \ | |
30 | > $(@:%.ok=%/refs.txt) | |
31 | $(GREP) -o 'JDK[1-9][0-9_]*HOME' $(TOPDIR)/make/Makefile | $(SED) -e 's/.*://' | $(SORT) -u \ | |
32 | > $(@:%.ok=%/sanity.txt) | |
33 | if $(DIFF) $(@:%.ok=%/refs.txt) $(@:%.ok=%/sanity.txt) ; then \ | |
34 | echo "expected defs found" ; \ | |
35 | else \ | |
36 | echo "differences found" ; exit 1 ; \ | |
37 | fi | |
38 | echo "test passed at `date`" > $@ | |
39 | ||
40 | TESTS.jtreg += $(BUILDDIR)/TestSanityTest.ok |
40 | 40 | $(TESTDIR)/testng-junit \ |
41 | 41 | > $(@:%.ok=%/jt.log) 2>&1 |
42 | 42 | $(GREP) -s 'Test results: passed: 2' $(@:%.ok=%/jt.log) > /dev/null |
43 | $(GREP) -s 'Total tests run: 3, Failures: 0, Skips: 0' $(@:%.ok=%/work)/testng/p/T1.jtr > /dev/null | |
44 | $(GREP) -s 'Total tests run: 3, Failures: 0, Skips: 0' $(@:%.ok=%/work)/testng/p/T2.jtr > /dev/null | |
43 | $(GREP) -s 'Total tests run: 3, Passes: 3, Failures: 0, Skips: 0' $(@:%.ok=%/work)/testng/p/T1.jtr > /dev/null | |
44 | $(GREP) -s 'Total tests run: 3, Passes: 3, Failures: 0, Skips: 0' $(@:%.ok=%/work)/testng/p/T2.jtr > /dev/null | |
45 | 45 | echo $@ passed at `date` > $@ |
46 | 46 | |
47 | 47 | ifdef JDK8HOME |
31 | 31 | $(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
32 | 32 | $(JTREG_IMAGEDIR)/bin/jtreg |
33 | 33 | $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ |
34 | -jdk:$(JDKHOME) -Dfoo=bar -Xbootclasspath/p:baz \ | |
34 | -jdk:$(JDK8HOME) -Dfoo=bar -Xbootclasspath/p:baz \ | |
35 | 35 | -w:$(BUILDDIR)/jtreg/cmd.othervm/work \ |
36 | 36 | -r:$(BUILDDIR)/jtreg/cmd.othervm/report \ |
37 | 37 | -verbose:fail \ |
38 | 38 | $(TESTDIR)/vmopts |
39 | 39 | ifdef ANT |
40 | JAVA_HOME=$(JDKHOME) $(ANT) -f $(TESTDIR)/vmopts/build.xml \ | |
40 | JAVA_HOME=$(JDK8HOME) $(ANT) -f $(TESTDIR)/vmopts/build.xml \ | |
41 | 41 | -Dbuild.jtreg=$(BUILDDIR)/jtreg \ |
42 | 42 | -Djtreg.jar=$(JTREG_IMAGEDIR)/lib/jtreg.jar \ |
43 | -Dtestjdk=$(JDKHOME) | |
43 | -Dtestjdk=$(JDK8HOME) | |
44 | 44 | endif |
45 | 45 | echo "test passed at `date`" > $@ |
46 | 46 | |
47 | ifdef JDK8HOME | |
47 | 48 | TESTS.jtreg += $(BUILDDIR)/TestVMOpts.ok |
49 | endif | |
48 | 50 | |
51 |