summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McDermott <andrew.mcdermott@linaro.org>2014-01-29 15:39:09 +0000
committerAndrew McDermott <andrew.mcdermott@linaro.org>2014-01-29 15:42:36 +0000
commit17b235dc789a605eee4d442925ba8f4ef67c335e (patch)
treea2d43eaf3cea9133bedd396f894ab58d57dd207e
parentabd295d71623bfe502a1454adf4cb899640c0610 (diff)
Switch to jtreg-4.2HEADmaster
Commit is 2f0c51ac5a73 which has my patch for handling corrupt JTreport/summary.txt files. Upstream parent commit is e08a5e0b79ba from: http://hg.openjdk.java.net/code-tools/jtreg Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
-rw-r--r--jtreg-4.2.0-2f0c51ac5a73.tar.xzbin0 -> 6725652 bytes
-rw-r--r--jtreg.patch53
-rw-r--r--jtreg/doc/jtreg/faq.html216
-rw-r--r--jtreg/doc/jtreg/usage.txt52
-rw-r--r--jtreg/lib/javatest.jarbin4607227 -> 4613089 bytes
-rw-r--r--jtreg/lib/jcommander.jarbin0 -> 30105 bytes
-rw-r--r--jtreg/lib/jh.jarbin500645 -> 508396 bytes
-rw-r--r--jtreg/lib/jtreg.jarbin518027 -> 560297 bytes
-rw-r--r--jtreg/lib/testng.jarbin755983 -> 1377268 bytes
-rwxr-xr-xjtreg/linux/bin/jtdiff33
-rwxr-xr-xjtreg/linux/bin/jtreg53
-rwxr-xr-xjtreg/solaris/bin/jtdiff33
-rwxr-xr-xjtreg/solaris/bin/jtreg53
-rwxr-xr-xjtreg/win32/bin/jtdiff33
-rwxr-xr-xjtreg/win32/bin/jtreg53
15 files changed, 349 insertions, 230 deletions
diff --git a/jtreg-4.2.0-2f0c51ac5a73.tar.xz b/jtreg-4.2.0-2f0c51ac5a73.tar.xz
new file mode 100644
index 0000000..e54e8a1
--- /dev/null
+++ b/jtreg-4.2.0-2f0c51ac5a73.tar.xz
Binary files differ
diff --git a/jtreg.patch b/jtreg.patch
new file mode 100644
index 0000000..5133a27
--- /dev/null
+++ b/jtreg.patch
@@ -0,0 +1,53 @@
+# HG changeset patch
+# User Andrew McDermott <andrew.mcdermott@linaro.org>
+# Date 1390932496 0
+# Node ID 2f0c51ac5a7313e2199c412e02e0532627409ea3
+# Parent e08a5e0b79ba57743222bbea19c0bdb142968769
+jtreg: handle StringIndexOutOfBoundsException when parsing summary.txt
+
+Handle a case where a badly formatted summary.txt causes a
+StringIndexOutOfBoundsException to be generated. This can happen when
+the format in the summary.txt file has additional lines of output from
+a failed test.
+
+A real-world example is as follows:
+
+runtime/8026365/InvokeSpecialAnonTest.java Passed. Execution successful
+runtime/8026394/InterfaceObjectTest.java Passed. Execution successful
+runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java Passed. Execution successful
+runtime/ClassFile/JsrRewriting.java Failed. Execution failed: `main' [...elided...]
+java.lang.LinkageError
+java.lang.NoSuchMethodError
+Main method not found in class OOMCrashClass4000_1
+runtime/ClassFile/OomWhileParsingRepeatedJsr.java Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: 'Cannot reserve enough memory' missing from stdout/stderr
+runtime/ClassUnload/KeepAliveClass.java Passed. Execution successful
+runtime/ClassUnload/KeepAliveClassLoader.java Passed. Execution successful
+
+diff --git a/src/share/classes/com/sun/javatest/diff/Diff.java b/src/share/classes/com/sun/javatest/diff/Diff.java
+--- a/src/share/classes/com/sun/javatest/diff/Diff.java
++++ b/src/share/classes/com/sun/javatest/diff/Diff.java
+@@ -75,7 +75,9 @@
+ int[] counts = new int[Status.NUM_STATES];
+ for (TestResult tr: r) {
+ table.addRow(index, tr.getTestName(), tr);
+- counts[tr.getStatus().getType()]++;
++ if (tr.getStatus() != null) {
++ counts[tr.getStatus().getType()]++;
++ }
+ }
+ testCounts.add(counts);
+ }
+diff --git a/src/share/classes/com/sun/javatest/diff/ReportReader.java b/src/share/classes/com/sun/javatest/diff/ReportReader.java
+--- a/src/share/classes/com/sun/javatest/diff/ReportReader.java
++++ b/src/share/classes/com/sun/javatest/diff/ReportReader.java
+@@ -105,8 +105,8 @@
+ String line;
+ while ((line = in.readLine()) != null) {
+ int sp = line.indexOf(' ');
+- String t = line.substring(0, sp);
+- Status s = Status.parse(line.substring(sp).trim());
++ String t = line.substring(0, sp == -1 ? line.length() : sp);
++ Status s = Status.parse(line.substring(sp == -1 ? line.length() : sp).trim());
+ TestDescription td = new TestDescription(root, new File(t), Collections.emptyMap());
+ TestResult tr = new TestResult(td, s);
+ list.add(tr);
diff --git a/jtreg/doc/jtreg/faq.html b/jtreg/doc/jtreg/faq.html
index 2a7733f..efc6a66 100644
--- a/jtreg/doc/jtreg/faq.html
+++ b/jtreg/doc/jtreg/faq.html
@@ -508,8 +508,8 @@
<a href="tag-spec.txt">JDK Test Framework: Tag Language Specification</a>
provides the needed descriptions.
<code>regtest</code> refers to extensions for the JavaTest harness that
- implement this specification, and is an older name for what is now known as
- "jtreg".</p>
+ implement this specification, and is an older name for what is now known as
+ "jtreg".</p>
<h3>
<a name="question1.6">1.6.
@@ -1582,11 +1582,11 @@ public class OneZero {
JDK regression test suite assume that MKS is available. So, when you
are writing tests for that test suite, you should make sure that your
test at least works with MKS. If you prefer to use Cygwin, and can make
- your test run with both, so much the better.</p>
+ your test run with both, so much the better.</p>
<p>
<strong>Note:</strong> as of JDK 8, the
- tests assume the use of Cygwin by default.</p>
+ tests assume the use of Cygwin by default.</p>
<h3>
<a name="question3.14">3.14.
@@ -1626,10 +1626,10 @@ public class OneZero {
the JDK being tested. For example, Linux does not currently support 64-bit
operation. Thus, the option <code>-d64</code> is not valid on
Linux and will be rejected.</p>
-
+
<p>You can also use the <code>-vmoption</code> or <code>-vmoptions</code>
- option to pass one or a space-separated list of options to the JVM used
- to run the test. </p>
+ option to pass one or a space-separated list of options to the JVM used
+ to run the test. </p>
<p></p>
<hr>
@@ -1642,15 +1642,15 @@ public class OneZero {
</a>
</h3>
-<p>The "test root directory", or "test suite root directory" is the
- root directory of the overall test suite.
- In OpenJDK terms, this means either of the "jdk/test/" or
+<p>The "test root directory", or "test suite root directory" is the
+ root directory of the overall test suite.
+ In OpenJDK terms, this means either of the "jdk/test/" or
"langtools/test/" directories in an OpenJDK forest.</p>
<p>The "test root directory" for any test is determined by finding
- the smallest enclosing directory containing a marker file called
- TEST.ROOT.
- The TEST.ROOT file can also be used to define some global properties
+ the smallest enclosing directory containing a marker file called
+ TEST.ROOT.
+ The TEST.ROOT file can also be used to define some global properties
for the test suite.</p>
<h3>
@@ -1659,14 +1659,14 @@ public class OneZero {
</a>
</h3>
-<p>Within the test suite, tests are uniquely identified by their path
- relative to the test root directory.
- This relative path is used to generate test-specific directories
- and files within the work directory, and to identify test results
+<p>Within the test suite, tests are uniquely identified by their path
+ relative to the test root directory.
+ This relative path is used to generate test-specific directories
+ and files within the work directory, and to identify test results
within the report directory.</p>
<p>However, note that tests can be specified on the command line
- by any valid file system path, either absolute or relative to the
+ by any valid file system path, either absolute or relative to the
current directory.
</p>
@@ -1676,14 +1676,14 @@ public class OneZero {
</a>
</h3>
-<p>In general, no. Each test is uniquely associated with
- exactly one test root directory, which is the the smallest
- enclosing directory containing a marker file called TEST.ROOT.
- In general, a test run will consist of tests from a single
+<p>In general, no. Each test is uniquely associated with
+ exactly one test root directory, which is the the smallest
+ enclosing directory containing a marker file called TEST.ROOT.
+ In general, a test run will consist of tests from a single
test suite, identified by a single test root directory.
</p>
-<p>It <em>is</em> possible to run tests from multiple test suites
+<p>It <em>is</em> possible to run tests from multiple test suites
(such as jdk/test and langtools/test) but this is not common. </p>
<h3>
@@ -1692,17 +1692,17 @@ public class OneZero {
</a>
</h3>
-<p>"package root" refers the root of the package hierarchy in
- which a Java source is placed. It is the directory you would
- put on the javac source path if you wanted javac to compile
+<p>"package root" refers the root of the package hierarchy in
+ which a Java source is placed. It is the directory you would
+ put on the javac source path if you wanted javac to compile
the file explicitly.</p>
-<p>Most jtreg tests are written in the "unnamed package"
- (i.e. without a package statement) and so for most jtreg tests,
- the directory directly containing the test is the package root
- for the test. This is different from other test suites using
- other test harnesses (such as TestNG) in which all the tests
- of a test suite are placed in a single package hierarchy,
+<p>Most jtreg tests are written in the "unnamed package"
+ (i.e. without a package statement) and so for most jtreg tests,
+ the directory directly containing the test is the package root
+ for the test. This is different from other test suites using
+ other test harnesses (such as TestNG) in which all the tests
+ of a test suite are placed in a single package hierarchy,
often mirroring the package hierarchy of API being tested.</p>
<h3>
@@ -1711,40 +1711,40 @@ public class OneZero {
</a>
</h3>
-<p>jtreg supports TestNG tests in two ways.</p>
+<p>jtreg supports TestNG tests in two ways.</p>
<ol>
<li>
-<p>Tests can be written with a full test description
- (the comment beginning /* @test....*/) and can use the following
+<p>Tests can be written with a full test description
+ (the comment beginning /* @test....*/) and can use the following
action tag to run the test with TestNG: </p>
-<pre>"@run testng classname args"</pre>
+<pre>"@run testng classname args"</pre>
-<p>Such a test would otherwise be similar to a standard test
- using "@run main". You can use other tags such as @library and
- @build, just as you would for "@run main".
- These tests would normally be in the unnamed directory
- (i.e. no package statement.)
- These tests can be freely intermixed with other tests using
+<p>Such a test would otherwise be similar to a standard test
+ using "@run main". You can use other tags such as @library and
+ @build, just as you would for "@run main".
+ These tests would normally be in the unnamed directory
+ (i.e. no package statement.)
+ These tests can be freely intermixed with other tests using
"@run main", "@run shell", "@run applet" and so on. </p>
-</li>
+</li>
<li>
-<p>If you have a group of TestNG tests written in their own
- package hierarchy, you can include that entire package
- hierarchy as a subdirectory under the main test root directory.
- If you do this, you must identify the root directory of that
- package hierarchy to jtreg, so that it knows to treat all the
- files in that package hierarchy specially.
- In such a group of tests, you do not need to provide test
- descriptions in each test.
- You may optionally provide a test description if you choose to
- do so, if you wish to specify information tags such as
- @bug, @summary and @keyword.
- You must not specify any action tags, such as @run, @compile,
- etc, since the actions are implicit for every test in the group
+<p>If you have a group of TestNG tests written in their own
+ package hierarchy, you can include that entire package
+ hierarchy as a subdirectory under the main test root directory.
+ If you do this, you must identify the root directory of that
+ package hierarchy to jtreg, so that it knows to treat all the
+ files in that package hierarchy specially.
+ In such a group of tests, you do not need to provide test
+ descriptions in each test.
+ You may optionally provide a test description if you choose to
+ do so, if you wish to specify information tags such as
+ @bug, @summary and @keyword.
+ You must not specify any action tags, such as @run, @compile,
+ etc, since the actions are implicit for every test in the group
of tests. </p>
</li>
@@ -1754,25 +1754,25 @@ public class OneZero {
<a name="question4.6">4.6.
How do I identify a group of TestNG tests in their own directory?
</a>
-</h3>
+</h3>
<p>Add a line specifying the directory to TEST.ROOT</p>
<pre>TestNG.dirs = dir1 dir2 dir3 ...</pre>
<p>Include the package root directory for each group of TestNG
- tests, and specify the package root directory relative to the test
+ tests, and specify the package root directory relative to the test
root directory.
</p>
-<p>You can also override the value in TEST.ROOT by using the
- TEST.properties file in any subdirectory of the test root directory
- that contains the package root.
+<p>You can also override the value in TEST.ROOT by using the
+ TEST.properties file in any subdirectory of the test root directory
+ that contains the package root.
If you put the declaration in a TEST.properties file, you can
specify the path relative to the directory containing the
TEST.properties file.
- In particular, instead of declaring the directory in TEST.ROOT,
- you could place the declaration in a TEST.properties file in the
+ In particular, instead of declaring the directory in TEST.ROOT,
+ you could place the declaration in a TEST.properties file in the
package root directory for the group of tests, in which case
the declaration would be simply:
</p>
@@ -1783,17 +1783,17 @@ public class OneZero {
<a name="question4.7">4.7.
How does jtreg run TestNG tests?
</a>
-</h3>
-
-<p>Tests using "@run testng" are compiled in the standard way,
- with TestNG libraries on the classpath.
- The test is run using the class <code>org.testng.TestNG</code>.
- For any TestNG test in a group of TestNG tests, any tests in the
- group that need compiling are compiled together before any
- test in the group is run.
- Then, the selected test classes are run one at a time using
- <code>org.testng.TestNG</code>.
- Each test that is run will have its results stored in a
+</h3>
+
+<p>Tests using "@run testng" are compiled in the standard way,
+ with TestNG libraries on the classpath.
+ The test is run using the class <code>org.testng.TestNG</code>.
+ For any TestNG test in a group of TestNG tests, any tests in the
+ group that need compiling are compiled together before any
+ test in the group is run.
+ Then, the selected test classes are run one at a time using
+ <code>org.testng.TestNG</code>.
+ Each test that is run will have its results stored in a
corresponding *.jtr file.
</p>
@@ -1801,28 +1801,28 @@ public class OneZero {
<a name="question4.8">4.8.
How do I specify any libraries I want to use in TestNG tests?
</a>
-</h3>
+</h3>
-<p>Tests using "@run testng" can use @library and @build in
- the standard way.
- For any test in a group of TestNG tests, you can specify the
- library by adding a line specifying the library in the
- TEST.properties file in the package root directory for the group of
+<p>Tests using "@run testng" can use @library and @build in
+ the standard way.
+ For any test in a group of TestNG tests, you can specify the
+ library by adding a line specifying the library in the
+ TEST.properties file in the package root directory for the group of
tests.
</p>
<pre>lib.dirs = path-to-library ...</pre>
-<p>As with the @library tag, if the path begins with "/",
- it will be evaluated relative to the test root directory;
- otherwise, it will be evaluated relative to the directory
+<p>As with the @library tag, if the path begins with "/",
+ it will be evaluated relative to the test root directory;
+ otherwise, it will be evaluated relative to the directory
containing the TEST.properties file.
</p>
-<p>For any particular group of TestNG tests, you can only
- specify libraries for the entire group: you cannot specify one
- library for some of the tests and another library for other tests.
- This is because the all the source files in the group are
+<p>For any particular group of TestNG tests, you can only
+ specify libraries for the entire group: you cannot specify one
+ library for some of the tests and another library for other tests.
+ This is because the all the source files in the group are
compiled together.
</p>
@@ -1952,10 +1952,10 @@ public class OneZero {
What is "agent VM" mode, and why would I want to use it?</a>
</h3>
-<p>It's like "same VM" mode, but better. By default, tests will run in
- the same JVM. In between tests, jtreg will try to reset the JVM to
- a standard state, and if it cannot, it will discard the JVM and
- start another. </p>
+<p>It's like "same VM" mode, but better. By default, tests will run in
+ the same JVM. In between tests, jtreg will try to reset the JVM to
+ a standard state, and if it cannot, it will discard the JVM and
+ start another. </p>
<h3>
<a name="question5.7">5.7.
@@ -2040,7 +2040,7 @@ public class OneZero {
Linux )
echo "Linux" ;;
SunOS )
- echo "Solaris" ;;
+ echo "Solaris" ;;
Windows* )
echo "Windows" ;;
* )
@@ -2828,28 +2828,28 @@ public class OneZero {
<a name="question8.8">8.8.
<code>Error. JUnit not available</code></a>
</h3>
-
+
<p>To run JUnit tests within jtreg, you must have a copy of junit.jar
- available. To do this, you should do one of the following:</p>
-
+ available. To do this, you should do one of the following:</p>
+
<ul>
-
+
<li>Put junit.jar on the classpath used to run jtreg.</li>
-
+
<li>You can specify the location by setting the system property
- <code>junit.jar</code>
-</li>
-
-<li>Install a copy in the <em>jtreg</em><code>/lib</code> directory
- if it is not already present.</li>
-
+ <code>junit.jar</code>
+</li>
+
+<li>Install a copy in the <em>jtreg</em><code>/lib</code> directory
+ if it is not already present.</li>
+
</ul>
-
+
<p>
- If you do not have a copy of junit.jar on your system, you can download
- it from <a href="http://junit.org/">http://junit.org/</a>.
- </p>
-
+ If you do not have a copy of junit.jar on your system, you can download
+ it from <a href="http://junit.org/">http://junit.org/</a>.
+ </p>
+
<hr>
<dl>
<dt>
diff --git a/jtreg/doc/jtreg/usage.txt b/jtreg/doc/jtreg/usage.txt
index bf40276..1ee8537 100644
--- a/jtreg/doc/jtreg/usage.txt
+++ b/jtreg/doc/jtreg/usage.txt
@@ -1,7 +1,8 @@
Usage:
jtreg options... tests...
-Tests can be given as files or folders containing test files.
+Tests can be given as files or folders containing test files, or by means of
+test groups. Long lists of options and tests may be encapsulated in "at-files".
Verbose Options
@@ -30,6 +31,7 @@ Verbose Options
Documentation Options
Options for additional documentation
+
-h [words...] | -help [words...] | -usage [words...]
Command line help. Give words to see help info containing
those or use "-help all" to see all available help.
@@ -71,6 +73,9 @@ General Options
then give an "Error" result.
run Run the test, as though the @ignore tag were not
present.
+ -l | -listtests
+ List the tests that would be executed instead of executing
+ them.
-lock:<file> Lock file to use for tests in "exclusive access" directories
when running tests in multiple concurrent instances of
jtreg.
@@ -112,6 +117,11 @@ General Options
re-run any tests. A work directory containing the results of
the executed tests must be provided. The default location is
"./JTwork". To specify an alternate directory, use -workDir.
+ -show:Name of information in the results file, such as "rerun".
+ Show selected information from the results file for a test
+ -showGroups Show the expansion (to files and directories) of the groups
+ given on the command line. To see the expansion of all the
+ groups in a test suite, specify the name of the test suite.
-startHttpd Start the http server to view test results
-timeout:<number> | -timeoutFactor:<number>
A scaling factor to extend the default timeout of all tests.
@@ -273,6 +283,44 @@ JDK-related Options
-XX* | -Xms* | -Xmx*
Non-standard VM Options
+Tests Specifying collections of tests.
+
+ at-files Long lists of options and tests may be encapsulated in
+ "at-files". Place the options and/or tests in a file and
+ specify the name of the file on the command line with @file.
+ Options or tests that include white space should be enclosed
+ within either single or double quote characters. Comments
+ may be included in the file by prefixing them with '#'. To
+ specify an option beginning with '@' on the command line,
+ use "@@" to avoid @file expansion.
+
+ Groups A test suite may define named groups of tests. To specify
+ the name of a group of tests on the command line, use
+ test-suite-dir:group-name, where test-suite-dir is a path to
+ the root directory of the test suite (i.e the directory
+ containing the TEST.ROOT file), and where group-name is the
+ name of the group of tests defined in the test suite. If
+ test-suite-dir is omitted it defaults to the value of the
+ -dir option, if given, or to the current directory
+ otherwise.
+ (Note: on Windows, to avoid confusion with absolute path
+ names including a drive specifier, the test-suite-dir must
+ not be specified with a relative path consisting of a single
+ letter.)
+
+ Groups are defined in a test suite using one or more Java
+ properties files. The names of these files must be listed in
+ the "groups" entry in TEST.ROOT. If the filename is enclosed
+ in square brackets, no error message will be given if the
+ file cannot be found. Within the property files, each entry
+ specifies items to be included or excluded from the group.
+ To include a test or directory of tests, simply specify the
+ name of the test or directory. To exclude a test or
+ directory of tests, use '-' followed by the name of the test
+ or directory. To include the contents of another group, use
+ ':' followed by the name of the group. There must be no
+ spaces between the "-" or ":" and the name that follows.
+
For more details and examples, see the online help. You can access this directly
from the command line with "-onlineHelp <word>...", or you can start the
@@ -281,6 +329,6 @@ JavaTest harness and use the Help menu.
jtreg can also be run with Ant. See the online help for details. For example,
use the "-onlineHelp ant" command line option.
-Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
diff --git a/jtreg/lib/javatest.jar b/jtreg/lib/javatest.jar
index c24101f..9db04a9 100644
--- a/jtreg/lib/javatest.jar
+++ b/jtreg/lib/javatest.jar
Binary files differ
diff --git a/jtreg/lib/jcommander.jar b/jtreg/lib/jcommander.jar
new file mode 100644
index 0000000..a0020f1
--- /dev/null
+++ b/jtreg/lib/jcommander.jar
Binary files differ
diff --git a/jtreg/lib/jh.jar b/jtreg/lib/jh.jar
index e5748fb..94e49c5 100644
--- a/jtreg/lib/jh.jar
+++ b/jtreg/lib/jh.jar
Binary files differ
diff --git a/jtreg/lib/jtreg.jar b/jtreg/lib/jtreg.jar
index 1c42f21..b313852 100644
--- a/jtreg/lib/jtreg.jar
+++ b/jtreg/lib/jtreg.jar
Binary files differ
diff --git a/jtreg/lib/testng.jar b/jtreg/lib/testng.jar
index 3852446..dd6c8bb 100644
--- a/jtreg/lib/testng.jar
+++ b/jtreg/lib/testng.jar
Binary files differ
diff --git a/jtreg/linux/bin/jtdiff b/jtreg/linux/bin/jtdiff
index 65b0679..3589ff1 100755
--- a/jtreg/linux/bin/jtdiff
+++ b/jtreg/linux/bin/jtdiff
@@ -1,7 +1,6 @@
#!/bin/sh
-
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -35,11 +34,16 @@
#
# $JT_JAVA is used to specify the version of java to use when running JavaTest
# (e.g. /usr/local/java/jdk1.5.0/solaris-sparc/bin/java)
-#
+#
# jtdiff also provides an Ant task for direct invocation from Ant.
# Determine jtdiff/JavaTest installation directory
-if [ -z "$JT_HOME" ]; then
+if [ -n "$JT_HOME" ]; then
+ if [ ! -r $JT_HOME/lib/jtreg.jar ];then
+ echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
+ exit 1;
+ fi
+else
# Deduce where script is installed
# - should work on most derivatives of Bourne shell, like ash, bash, ksh,
# sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash)
@@ -49,7 +53,7 @@ if [ -z "$JT_HOME" ]; then
myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
elif whence whence 1>/dev/null 2>&1 ; then
myname=`whence "$0"`
- fi
+ fi
mydir=`dirname "$myname"`
p=`cd "$mydir" ; pwd`
while [ -n "$p" -a "$p" != "/" ]; do
@@ -59,11 +63,13 @@ if [ -z "$JT_HOME" ]; then
if [ -z "$JT_HOME" ]; then
echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
fi
- case "`uname -s`" in
- CYGWIN* ) JT_HOME=`cygpath -m "$JT_HOME"` ;;
- esac
fi
+# Normalize JT_HOME if using Cygwin
+case "`uname -s`" in
+ CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;;
+esac
+
# Separate out -J* options for the JVM
# Unset IFS and use newline as arg separator to preserve spaces in args
@@ -73,7 +79,8 @@ nl='
'
for i in "$@" ; do
IFS=
- case $i in
+ if [ -n "$cygwin" ]; then i=`echo $i | sed -e 's|/cygdrive/\([A-Za-z]\)/|\1:/|'` ; fi
+ case $i in
-J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
* ) jtdiffOpts=$jtdiffOpts$nl$i ;;
esac
@@ -83,17 +90,17 @@ unset DUALCASE
# Determine java for jtdiff, from JT_JAVA, JAVA_HOME, java
if [ -n "$JT_JAVA" ]; then
- if [ -d "$JT_JAVA" ]; then
- JT_JAVA="$JT_JAVA/bin/java"
+ if [ -d "$JT_JAVA" ]; then
+ JT_JAVA="$JT_JAVA/bin/java"
fi
-elif [ -n "$JAVA_HOME" ]; then
+elif [ -n "$JAVA_HOME" ]; then
JT_JAVA="$JAVA_HOME/bin/java"
else
JT_JAVA=java
fi
# Verify java version (1.)5 or newer used to run jtdiff
-version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
+version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
if [ -z "$version" ]; then
diff --git a/jtreg/linux/bin/jtreg b/jtreg/linux/bin/jtreg
index 3d9657f..4ca98a4 100755
--- a/jtreg/linux/bin/jtreg
+++ b/jtreg/linux/bin/jtreg
@@ -1,7 +1,6 @@
#!/bin/sh
-
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -25,23 +24,15 @@
# questions.
#
-# !!!!! This script provides an alternate entry point into JavaTest. It directs
-# !!!!! JavaTest to use a highly customized script and test finder. It is an
-# !!!!! example of how to extend JavaTest to run using specific environments
-# !!!!! and properties for test suites using procedural test descriptions.
-# !!!!!
-# !!!!! "jtreg" does not run JCK-style tests. Please refer to the "javatest"
-# !!!!! script to run the JCK or testsuites following the JCK style.
-
# Usage:
# jtreg ...args....
-# Run the application via the regression test-suite front end
-# with the given arguments.
-# The Java runtime used to run JavaTest is found as follows:
-# - $JT_JAVA is used, if it is set
+# Run the application via the regression test-suite front end
+# with the given arguments.
+# The Java runtime used to run JavaTest is found as follows:
+# - $JT_JAVA is used, if it is set
# - Otherwise, $JAVA_HOME/bin/java is used if $JAVA_HOME is set
# (cf JDK.)
-# - Otherwise, "java" is used
+# - Otherwise, "java" is used
#
# jtreg requires a version of Java equivalent to JDK 1.5.0 or higher.
@@ -53,12 +44,17 @@
#
# You can also run the jar file directly, as in
# java -jar <path>/lib/jtreg.jar ...args...
-#
+#
# jtreg also provides Ant tasks; see the online help for details.
# E.g. jtreg -onlineHelp ant
# Determine jtreg/JavaTest installation directory
-if [ -z "$JT_HOME" ]; then
+if [ -n "$JT_HOME" ]; then
+ if [ ! -r $JT_HOME/lib/jtreg.jar ];then
+ echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
+ exit 1;
+ fi
+else
# Deduce where script is installed
# - should work on most derivatives of Bourne shell, like ash, bash, ksh,
# sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash)
@@ -68,7 +64,7 @@ if [ -z "$JT_HOME" ]; then
myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
elif whence whence 1>/dev/null 2>&1 ; then
myname=`whence "$0"`
- fi
+ fi
mydir=`dirname "$myname"`
p=`cd "$mydir" ; pwd`
while [ -n "$p" -a "$p" != "/" ]; do
@@ -78,11 +74,13 @@ if [ -z "$JT_HOME" ]; then
if [ -z "$JT_HOME" ]; then
echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
fi
- case "`uname -s`" in
- CYGWIN* ) JT_HOME=`cygpath -m "$JT_HOME"` ;;
- esac
fi
+# Normalize JT_HOME if using Cygwin
+case "`uname -s`" in
+ CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;;
+esac
+
# Separate out -J* options for the JVM
# Note jdk as possible default to run jtreg
@@ -93,7 +91,8 @@ nl='
'
for i in "$@" ; do
IFS=
- case $i in
+ if [ -n "$cygwin" ]; then i=`echo $i | sed -e 's|/cygdrive/\([A-Za-z]\)/|\1:/|'` ; fi
+ case $i in
-jdk:* ) jdk="`echo $i | sed -e 's/^-jdk://'`"
jtregOpts=$jtregOpts$nl$i ;;
-J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
@@ -103,12 +102,12 @@ for i in "$@" ; do
done
unset DUALCASE
-# Determine java for jtreg, from JT_JAVA, JAVA_HOME, jdk, java
+# Determine java for jtreg, from JT_JAVA, JAVA_HOME, -jdk, java
if [ -n "$JT_JAVA" ]; then
- if [ -d "$JT_JAVA" ]; then
- JT_JAVA="$JT_JAVA/bin/java"
+ if [ -d "$JT_JAVA" ]; then
+ JT_JAVA="$JT_JAVA/bin/java"
fi
-elif [ -n "$JAVA_HOME" ]; then
+elif [ -n "$JAVA_HOME" ]; then
JT_JAVA="$JAVA_HOME/bin/java"
elif [ -n "$jdk" ]; then
JT_JAVA="$jdk/bin/java"
@@ -117,7 +116,7 @@ else
fi
# Verify java version (1.)5 or newer used to run jtreg
-version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
+version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
if [ -z "$version" ]; then
diff --git a/jtreg/solaris/bin/jtdiff b/jtreg/solaris/bin/jtdiff
index 65b0679..3589ff1 100755
--- a/jtreg/solaris/bin/jtdiff
+++ b/jtreg/solaris/bin/jtdiff
@@ -1,7 +1,6 @@
#!/bin/sh
-
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -35,11 +34,16 @@
#
# $JT_JAVA is used to specify the version of java to use when running JavaTest
# (e.g. /usr/local/java/jdk1.5.0/solaris-sparc/bin/java)
-#
+#
# jtdiff also provides an Ant task for direct invocation from Ant.
# Determine jtdiff/JavaTest installation directory
-if [ -z "$JT_HOME" ]; then
+if [ -n "$JT_HOME" ]; then
+ if [ ! -r $JT_HOME/lib/jtreg.jar ];then
+ echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
+ exit 1;
+ fi
+else
# Deduce where script is installed
# - should work on most derivatives of Bourne shell, like ash, bash, ksh,
# sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash)
@@ -49,7 +53,7 @@ if [ -z "$JT_HOME" ]; then
myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
elif whence whence 1>/dev/null 2>&1 ; then
myname=`whence "$0"`
- fi
+ fi
mydir=`dirname "$myname"`
p=`cd "$mydir" ; pwd`
while [ -n "$p" -a "$p" != "/" ]; do
@@ -59,11 +63,13 @@ if [ -z "$JT_HOME" ]; then
if [ -z "$JT_HOME" ]; then
echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
fi
- case "`uname -s`" in
- CYGWIN* ) JT_HOME=`cygpath -m "$JT_HOME"` ;;
- esac
fi
+# Normalize JT_HOME if using Cygwin
+case "`uname -s`" in
+ CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;;
+esac
+
# Separate out -J* options for the JVM
# Unset IFS and use newline as arg separator to preserve spaces in args
@@ -73,7 +79,8 @@ nl='
'
for i in "$@" ; do
IFS=
- case $i in
+ if [ -n "$cygwin" ]; then i=`echo $i | sed -e 's|/cygdrive/\([A-Za-z]\)/|\1:/|'` ; fi
+ case $i in
-J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
* ) jtdiffOpts=$jtdiffOpts$nl$i ;;
esac
@@ -83,17 +90,17 @@ unset DUALCASE
# Determine java for jtdiff, from JT_JAVA, JAVA_HOME, java
if [ -n "$JT_JAVA" ]; then
- if [ -d "$JT_JAVA" ]; then
- JT_JAVA="$JT_JAVA/bin/java"
+ if [ -d "$JT_JAVA" ]; then
+ JT_JAVA="$JT_JAVA/bin/java"
fi
-elif [ -n "$JAVA_HOME" ]; then
+elif [ -n "$JAVA_HOME" ]; then
JT_JAVA="$JAVA_HOME/bin/java"
else
JT_JAVA=java
fi
# Verify java version (1.)5 or newer used to run jtdiff
-version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
+version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
if [ -z "$version" ]; then
diff --git a/jtreg/solaris/bin/jtreg b/jtreg/solaris/bin/jtreg
index 3d9657f..4ca98a4 100755
--- a/jtreg/solaris/bin/jtreg
+++ b/jtreg/solaris/bin/jtreg
@@ -1,7 +1,6 @@
#!/bin/sh
-
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -25,23 +24,15 @@
# questions.
#
-# !!!!! This script provides an alternate entry point into JavaTest. It directs
-# !!!!! JavaTest to use a highly customized script and test finder. It is an
-# !!!!! example of how to extend JavaTest to run using specific environments
-# !!!!! and properties for test suites using procedural test descriptions.
-# !!!!!
-# !!!!! "jtreg" does not run JCK-style tests. Please refer to the "javatest"
-# !!!!! script to run the JCK or testsuites following the JCK style.
-
# Usage:
# jtreg ...args....
-# Run the application via the regression test-suite front end
-# with the given arguments.
-# The Java runtime used to run JavaTest is found as follows:
-# - $JT_JAVA is used, if it is set
+# Run the application via the regression test-suite front end
+# with the given arguments.
+# The Java runtime used to run JavaTest is found as follows:
+# - $JT_JAVA is used, if it is set
# - Otherwise, $JAVA_HOME/bin/java is used if $JAVA_HOME is set
# (cf JDK.)
-# - Otherwise, "java" is used
+# - Otherwise, "java" is used
#
# jtreg requires a version of Java equivalent to JDK 1.5.0 or higher.
@@ -53,12 +44,17 @@
#
# You can also run the jar file directly, as in
# java -jar <path>/lib/jtreg.jar ...args...
-#
+#
# jtreg also provides Ant tasks; see the online help for details.
# E.g. jtreg -onlineHelp ant
# Determine jtreg/JavaTest installation directory
-if [ -z "$JT_HOME" ]; then
+if [ -n "$JT_HOME" ]; then
+ if [ ! -r $JT_HOME/lib/jtreg.jar ];then
+ echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
+ exit 1;
+ fi
+else
# Deduce where script is installed
# - should work on most derivatives of Bourne shell, like ash, bash, ksh,
# sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash)
@@ -68,7 +64,7 @@ if [ -z "$JT_HOME" ]; then
myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
elif whence whence 1>/dev/null 2>&1 ; then
myname=`whence "$0"`
- fi
+ fi
mydir=`dirname "$myname"`
p=`cd "$mydir" ; pwd`
while [ -n "$p" -a "$p" != "/" ]; do
@@ -78,11 +74,13 @@ if [ -z "$JT_HOME" ]; then
if [ -z "$JT_HOME" ]; then
echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
fi
- case "`uname -s`" in
- CYGWIN* ) JT_HOME=`cygpath -m "$JT_HOME"` ;;
- esac
fi
+# Normalize JT_HOME if using Cygwin
+case "`uname -s`" in
+ CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;;
+esac
+
# Separate out -J* options for the JVM
# Note jdk as possible default to run jtreg
@@ -93,7 +91,8 @@ nl='
'
for i in "$@" ; do
IFS=
- case $i in
+ if [ -n "$cygwin" ]; then i=`echo $i | sed -e 's|/cygdrive/\([A-Za-z]\)/|\1:/|'` ; fi
+ case $i in
-jdk:* ) jdk="`echo $i | sed -e 's/^-jdk://'`"
jtregOpts=$jtregOpts$nl$i ;;
-J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
@@ -103,12 +102,12 @@ for i in "$@" ; do
done
unset DUALCASE
-# Determine java for jtreg, from JT_JAVA, JAVA_HOME, jdk, java
+# Determine java for jtreg, from JT_JAVA, JAVA_HOME, -jdk, java
if [ -n "$JT_JAVA" ]; then
- if [ -d "$JT_JAVA" ]; then
- JT_JAVA="$JT_JAVA/bin/java"
+ if [ -d "$JT_JAVA" ]; then
+ JT_JAVA="$JT_JAVA/bin/java"
fi
-elif [ -n "$JAVA_HOME" ]; then
+elif [ -n "$JAVA_HOME" ]; then
JT_JAVA="$JAVA_HOME/bin/java"
elif [ -n "$jdk" ]; then
JT_JAVA="$jdk/bin/java"
@@ -117,7 +116,7 @@ else
fi
# Verify java version (1.)5 or newer used to run jtreg
-version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
+version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
if [ -z "$version" ]; then
diff --git a/jtreg/win32/bin/jtdiff b/jtreg/win32/bin/jtdiff
index 65b0679..3589ff1 100755
--- a/jtreg/win32/bin/jtdiff
+++ b/jtreg/win32/bin/jtdiff
@@ -1,7 +1,6 @@
#!/bin/sh
-
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -35,11 +34,16 @@
#
# $JT_JAVA is used to specify the version of java to use when running JavaTest
# (e.g. /usr/local/java/jdk1.5.0/solaris-sparc/bin/java)
-#
+#
# jtdiff also provides an Ant task for direct invocation from Ant.
# Determine jtdiff/JavaTest installation directory
-if [ -z "$JT_HOME" ]; then
+if [ -n "$JT_HOME" ]; then
+ if [ ! -r $JT_HOME/lib/jtreg.jar ];then
+ echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
+ exit 1;
+ fi
+else
# Deduce where script is installed
# - should work on most derivatives of Bourne shell, like ash, bash, ksh,
# sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash)
@@ -49,7 +53,7 @@ if [ -z "$JT_HOME" ]; then
myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
elif whence whence 1>/dev/null 2>&1 ; then
myname=`whence "$0"`
- fi
+ fi
mydir=`dirname "$myname"`
p=`cd "$mydir" ; pwd`
while [ -n "$p" -a "$p" != "/" ]; do
@@ -59,11 +63,13 @@ if [ -z "$JT_HOME" ]; then
if [ -z "$JT_HOME" ]; then
echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
fi
- case "`uname -s`" in
- CYGWIN* ) JT_HOME=`cygpath -m "$JT_HOME"` ;;
- esac
fi
+# Normalize JT_HOME if using Cygwin
+case "`uname -s`" in
+ CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;;
+esac
+
# Separate out -J* options for the JVM
# Unset IFS and use newline as arg separator to preserve spaces in args
@@ -73,7 +79,8 @@ nl='
'
for i in "$@" ; do
IFS=
- case $i in
+ if [ -n "$cygwin" ]; then i=`echo $i | sed -e 's|/cygdrive/\([A-Za-z]\)/|\1:/|'` ; fi
+ case $i in
-J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
* ) jtdiffOpts=$jtdiffOpts$nl$i ;;
esac
@@ -83,17 +90,17 @@ unset DUALCASE
# Determine java for jtdiff, from JT_JAVA, JAVA_HOME, java
if [ -n "$JT_JAVA" ]; then
- if [ -d "$JT_JAVA" ]; then
- JT_JAVA="$JT_JAVA/bin/java"
+ if [ -d "$JT_JAVA" ]; then
+ JT_JAVA="$JT_JAVA/bin/java"
fi
-elif [ -n "$JAVA_HOME" ]; then
+elif [ -n "$JAVA_HOME" ]; then
JT_JAVA="$JAVA_HOME/bin/java"
else
JT_JAVA=java
fi
# Verify java version (1.)5 or newer used to run jtdiff
-version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
+version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
if [ -z "$version" ]; then
diff --git a/jtreg/win32/bin/jtreg b/jtreg/win32/bin/jtreg
index 3d9657f..4ca98a4 100755
--- a/jtreg/win32/bin/jtreg
+++ b/jtreg/win32/bin/jtreg
@@ -1,7 +1,6 @@
#!/bin/sh
-
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -25,23 +24,15 @@
# questions.
#
-# !!!!! This script provides an alternate entry point into JavaTest. It directs
-# !!!!! JavaTest to use a highly customized script and test finder. It is an
-# !!!!! example of how to extend JavaTest to run using specific environments
-# !!!!! and properties for test suites using procedural test descriptions.
-# !!!!!
-# !!!!! "jtreg" does not run JCK-style tests. Please refer to the "javatest"
-# !!!!! script to run the JCK or testsuites following the JCK style.
-
# Usage:
# jtreg ...args....
-# Run the application via the regression test-suite front end
-# with the given arguments.
-# The Java runtime used to run JavaTest is found as follows:
-# - $JT_JAVA is used, if it is set
+# Run the application via the regression test-suite front end
+# with the given arguments.
+# The Java runtime used to run JavaTest is found as follows:
+# - $JT_JAVA is used, if it is set
# - Otherwise, $JAVA_HOME/bin/java is used if $JAVA_HOME is set
# (cf JDK.)
-# - Otherwise, "java" is used
+# - Otherwise, "java" is used
#
# jtreg requires a version of Java equivalent to JDK 1.5.0 or higher.
@@ -53,12 +44,17 @@
#
# You can also run the jar file directly, as in
# java -jar <path>/lib/jtreg.jar ...args...
-#
+#
# jtreg also provides Ant tasks; see the online help for details.
# E.g. jtreg -onlineHelp ant
# Determine jtreg/JavaTest installation directory
-if [ -z "$JT_HOME" ]; then
+if [ -n "$JT_HOME" ]; then
+ if [ ! -r $JT_HOME/lib/jtreg.jar ];then
+ echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
+ exit 1;
+ fi
+else
# Deduce where script is installed
# - should work on most derivatives of Bourne shell, like ash, bash, ksh,
# sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash)
@@ -68,7 +64,7 @@ if [ -z "$JT_HOME" ]; then
myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
elif whence whence 1>/dev/null 2>&1 ; then
myname=`whence "$0"`
- fi
+ fi
mydir=`dirname "$myname"`
p=`cd "$mydir" ; pwd`
while [ -n "$p" -a "$p" != "/" ]; do
@@ -78,11 +74,13 @@ if [ -z "$JT_HOME" ]; then
if [ -z "$JT_HOME" ]; then
echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
fi
- case "`uname -s`" in
- CYGWIN* ) JT_HOME=`cygpath -m "$JT_HOME"` ;;
- esac
fi
+# Normalize JT_HOME if using Cygwin
+case "`uname -s`" in
+ CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;;
+esac
+
# Separate out -J* options for the JVM
# Note jdk as possible default to run jtreg
@@ -93,7 +91,8 @@ nl='
'
for i in "$@" ; do
IFS=
- case $i in
+ if [ -n "$cygwin" ]; then i=`echo $i | sed -e 's|/cygdrive/\([A-Za-z]\)/|\1:/|'` ; fi
+ case $i in
-jdk:* ) jdk="`echo $i | sed -e 's/^-jdk://'`"
jtregOpts=$jtregOpts$nl$i ;;
-J* ) javaOpts=$javaOpts$nl`echo $i | sed -e 's/^-J//'` ;;
@@ -103,12 +102,12 @@ for i in "$@" ; do
done
unset DUALCASE
-# Determine java for jtreg, from JT_JAVA, JAVA_HOME, jdk, java
+# Determine java for jtreg, from JT_JAVA, JAVA_HOME, -jdk, java
if [ -n "$JT_JAVA" ]; then
- if [ -d "$JT_JAVA" ]; then
- JT_JAVA="$JT_JAVA/bin/java"
+ if [ -d "$JT_JAVA" ]; then
+ JT_JAVA="$JT_JAVA/bin/java"
fi
-elif [ -n "$JAVA_HOME" ]; then
+elif [ -n "$JAVA_HOME" ]; then
JT_JAVA="$JAVA_HOME/bin/java"
elif [ -n "$jdk" ]; then
JT_JAVA="$jdk/bin/java"
@@ -117,7 +116,7 @@ else
fi
# Verify java version (1.)5 or newer used to run jtreg
-version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
+version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.GetSystemProperty java.version 2>&1 |
grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
if [ -z "$version" ]; then