author | stefank |
Mon, 25 Aug 2014 09:10:13 +0200 | |
changeset 26314 | f8bc1966fb30 |
parent 22602 | 0d9a07b0d7e9 |
permissions | -rw-r--r-- |
2 | 1 |
#!/bin/sh |
2 |
||
3 |
# |
|
14342
8435a30053c1
7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents:
12047
diff
changeset
|
4 |
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
2 | 5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6 |
# |
|
7 |
# This code is free software; you can redistribute it and/or modify it |
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
|
9 |
# published by the Free Software Foundation. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 24 |
# |
25 |
||
26 |
||
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
27 |
# Common setup for tool tests and other tests that use jtools. |
2 | 28 |
# Checks that TESTJAVA, TESTSRC, and TESTCLASSES environment variables are set. |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
29 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
30 |
# Creates the following constants for use by the caller: |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
31 |
# JAVA - java launcher |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
32 |
# JHAT - jhat utility |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
33 |
# JINFO - jinfo utility |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
34 |
# JMAP - jmap utility |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
35 |
# JPS - jps utility |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
36 |
# JSTACK - jstack utility |
11365 | 37 |
# JCMD - jcmd utility |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
38 |
# OS - operating system name |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
39 |
# PATTERN_EOL - grep or sed end-of-line pattern |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
40 |
# PATTERN_WS - grep or sed whitespace pattern |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
41 |
# PS - path separator (";" or ":") |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
42 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
43 |
# Sets the following variables: |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
44 |
# |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
45 |
# isCygwin - true if environment is Cygwin |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
46 |
# isMKS - true if environment is MKS |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
47 |
# isLinux - true if OS is Linux |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
48 |
# isSolaris - true if OS is Solaris |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
49 |
# isWindows - true if OS is Windows |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11365
diff
changeset
|
50 |
# isMacos - true if OS is Macos X |
22602
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
14342
diff
changeset
|
51 |
# isAIX - true if OS is AIX |
2 | 52 |
|
53 |
||
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
54 |
if [ -z "${TESTJAVA}" ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
55 |
echo "ERROR: TESTJAVA not set. Test cannot execute. Failed." |
2 | 56 |
exit 1 |
57 |
fi |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
58 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
59 |
if [ -z "${TESTSRC}" ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
60 |
echo "ERROR: TESTSRC not set. Test cannot execute. Failed." |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
61 |
exit 1 |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
62 |
fi |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
63 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
64 |
if [ -z "${TESTCLASSES}" ]; then |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
65 |
echo "ERROR: TESTCLASSES not set. Test cannot execute. Failed." |
2 | 66 |
exit 1 |
67 |
fi |
|
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
68 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
69 |
# only enable these after checking the expected incoming env variables |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
70 |
set -eu |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
71 |
|
2 | 72 |
JAVA="${TESTJAVA}/bin/java" |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
73 |
JHAT="${TESTJAVA}/bin/jhat" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
74 |
JINFO="${TESTJAVA}/bin/jinfo" |
2 | 75 |
JMAP="${TESTJAVA}/bin/jmap" |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
76 |
JPS="${TESTJAVA}/bin/jps" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
77 |
JSTACK="${TESTJAVA}/bin/jstack" |
11365 | 78 |
JCMD="${TESTJAVA}/bin/jcmd" |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
79 |
|
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
80 |
isCygwin=false |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
81 |
isMKS=false |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
82 |
isLinux=false |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
83 |
isSolaris=false |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
84 |
isUnknownOS=false |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
85 |
isWindows=false |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11365
diff
changeset
|
86 |
isMacos=false |
22602
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
14342
diff
changeset
|
87 |
isAIX=false |
2 | 88 |
|
89 |
OS=`uname -s` |
|
90 |
||
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
91 |
# start with some UNIX like defaults |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
92 |
PATTERN_EOL='$' |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
93 |
# blank and tab |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
94 |
PATTERN_WS='[ ]' |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
95 |
PS=":" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
96 |
|
2 | 97 |
case "$OS" in |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
98 |
CYGWIN* ) |
2 | 99 |
OS="Windows" |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
100 |
PATTERN_EOL='[ ]*$' |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
101 |
# blank and tab |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
102 |
PATTERN_WS='[ \t]' |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
103 |
isCygwin=true |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
104 |
isWindows=true |
2 | 105 |
;; |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
106 |
Linux ) |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
107 |
OS="Linux" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
108 |
isLinux=true |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
109 |
;; |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11365
diff
changeset
|
110 |
Darwin ) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11365
diff
changeset
|
111 |
OS="Mac OS X" |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11365
diff
changeset
|
112 |
isMacos=true |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11365
diff
changeset
|
113 |
;; |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
114 |
SunOS ) |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
115 |
OS="Solaris" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
116 |
isSolaris=true |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
117 |
;; |
22602
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
14342
diff
changeset
|
118 |
AIX ) |
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
14342
diff
changeset
|
119 |
OS="AIX" |
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
14342
diff
changeset
|
120 |
isAIX=true |
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
14342
diff
changeset
|
121 |
;; |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
122 |
Windows* ) |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
123 |
OS="Windows" |
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
124 |
PATTERN_EOL='[ ]*$' |
4663
dfea6ffdb0dc
6911104: Tests do not work with CYGWIN: tools, sun/tools, and com/sun/tools
ohair
parents:
2
diff
changeset
|
125 |
PS=";" |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
126 |
isWindows=true |
4663
dfea6ffdb0dc
6911104: Tests do not work with CYGWIN: tools, sun/tools, and com/sun/tools
ohair
parents:
2
diff
changeset
|
127 |
;; |
2 | 128 |
* ) |
6120
4979c5d548f8
6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents:
5506
diff
changeset
|
129 |
isUnknownOS=true |
2 | 130 |
;; |
131 |
esac |