hotspot/test/runtime/7110720/Test7110720.sh
author coleenp
Wed, 29 Aug 2012 14:49:05 -0400
changeset 13523 6a7f3e56a242
parent 13469 9a2973794d8c
child 16457 92af83361777
permissions -rw-r--r--
7191926: Remove MKS dependency in Hotspot regression tests Summary: Add case for CYGWIN in .sh files. Reviewed-by: coleenp, kvn Contributed-by: pavel.punegov@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     1
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     2
#  Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     3
#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     4
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     5
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     6
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     7
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     8
# @test Test7110720.sh
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
     9
# @bug 7110720
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    10
# @summary improve VM configuration file loading
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    11
# @run shell Test7110720.sh
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    12
#
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    13
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    14
if [ "${TESTSRC}" = "" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    15
  then TESTSRC=.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    16
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    17
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    18
if [ "${TESTJAVA}" = "" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    19
then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    20
  PARENT=`dirname \`which java\``
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    21
  TESTJAVA=`dirname ${PARENT}`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    22
  echo "TESTJAVA not set, selecting " ${TESTJAVA}
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    23
  echo "If this is incorrect, try setting the variable manually."
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    24
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    25
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    26
if [ "${TESTCLASSES}" = "" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    27
then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    28
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    29
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    30
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    31
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    32
# Jtreg sets TESTVMOPTS which may include -d64 which is
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    33
# required to test a 64-bit JVM on some platforms.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    34
# If another test harness still creates HOME/JDK64BIT,
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    35
# we can recognise that.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    36
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    37
# set platform-dependent variables
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    38
OS=`uname -s`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    39
case "$OS" in
13469
9a2973794d8c 7129723: MAC: Some regression tests need to recognize Mac OS X platform
coleenp
parents: 12981
diff changeset
    40
  SunOS | Linux | Darwin )
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    41
    FS="/"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    42
    RM=/bin/rm
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    43
    CP=/bin/cp
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    44
    MV=/bin/mv
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    45
    ## for solaris, linux it's HOME
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    46
    FILE_LOCATION=$HOME
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    47
    if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    48
    then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    49
        TESTVMOPTS=`cat ${FILE_LOCATION}${FS}JDK64BIT`
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    50
    fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    51
    ;;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    52
  Windows_* )
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    53
    FS="\\"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    54
    RM=rm
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    55
    CP=cp
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    56
    MV=mv
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    57
    ;;
13523
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    58
  CYGWIN_* )
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    59
    FS="/"
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    60
    RM=rm
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    61
    CP=cp
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    62
    MV=mv
6a7f3e56a242 7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents: 13469
diff changeset
    63
    ;;
12981
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    64
  * )
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    65
    echo "Unrecognized system!"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    66
    exit 1;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    67
    ;;
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    68
esac
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    69
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    70
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    71
JAVA=${TESTJAVA}${FS}bin${FS}java
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    72
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    73
# Don't test debug builds, they do read the config files:
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    74
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "debug" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    75
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    76
  echo Skipping test for debug build.
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    77
  exit 0
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    78
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    79
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    80
ok=yes
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    81
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    82
$RM -f .hotspot_compiler .hotspotrc
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    83
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    84
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    85
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    86
  echo "FAILED: base case failure"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    87
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    88
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    89
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    90
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    91
echo "garbage in, garbage out" > .hotspot_compiler
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    92
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    93
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    94
  echo "FAILED: .hotspot_compiler was read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    95
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    96
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    97
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    98
$MV .hotspot_compiler hs_comp.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
    99
${JAVA} ${TESTVMOPTS} -XX:CompileCommandFile=hs_comp.txt -version 2>&1 | grep "garbage in" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   100
if [ "$?" = "1" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   101
  echo "FAILED: explicit compiler command file not read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   102
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   103
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   104
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   105
$RM -f .hotspot_compiler hs_comp.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   106
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   107
echo "garbage" > .hotspotrc
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   108
${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   109
if [ "$?" = "0" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   110
  echo "FAILED: .hotspotrc was read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   111
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   112
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   113
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   114
$MV .hotspotrc hs_flags.txt
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   115
${JAVA} ${TESTVMOPTS} -XX:Flags=hs_flags.txt -version 2>&1 | grep "garbage" >/dev/null
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   116
if [ "$?" = "1" ]; then
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   117
  echo "FAILED: explicit flags file not read"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   118
  ok=no
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   119
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   120
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   121
if [ "${ok}" = "no" ]; then 
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   122
  echo "Some tests failed."
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   123
  exit 1
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   124
else 
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   125
  echo "Passed"
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   126
  exit 0
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   127
fi
b557c10f5444 7110720: Issue with vm config file loadingIssue with vm config file loading
kamg
parents:
diff changeset
   128