jdk/test/sun/tools/common/CommonSetup.sh
author simonis
Fri, 17 Jan 2014 21:54:30 +0100
changeset 22602 0d9a07b0d7e9
parent 14342 8435a30053c1
permissions -rw-r--r--
8028537: PPC64: Updated the JDK regression tests to run on AIX Reviewed-by: alanb Contributed-by: luchsh@linux.vnet.ibm.com, spoole@linux.vnet.ibm.com, volker.simonis@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#!/bin/sh
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4663
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4663
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4663
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
05d995976571 7104647: Adding a diagnostic command framework
fparain
parents: 6120
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
05d995976571 7104647: Adding a diagnostic command framework
fparain
parents: 6120
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
OS=`uname -s`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
case "$OS" in
6120
4979c5d548f8 6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents: 5506
diff changeset
    98
  CYGWIN* )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
  * )
6120
4979c5d548f8 6964018: 3/4 AnonLoggerWeakRefLeak and LoggerWeakRefLeak can fail in JPRT
dcubed
parents: 5506
diff changeset
   129
    isUnknownOS=true
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
esac