source: trunk/openjdk/hotspot/test/runtime/7110720/Test7110720.sh

Last change on this file was 406, checked in by dmik, 13 years ago

trunk: Merged in openjdk6 b27 from branches/vendor/oracle.

  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1#
2# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation.
8#
9# This code is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12# version 2 for more details (a copy is included in the LICENSE file that
13# accompanied this code).
14#
15# You should have received a copy of the GNU General Public License version
16# 2 along with this work; if not, write to the Free Software Foundation,
17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18#
19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20# or visit www.oracle.com if you need additional information or have any
21# questions.
22#
23
24
25#
26# @test Test7110720.sh
27# @bug 7110720
28# @summary improve VM configuration file loading
29# @run shell Test7110720.sh
30#
31
32if [ "${TESTSRC}" = "" ]
33 then TESTSRC=.
34fi
35
36if [ "${TESTJAVA}" = "" ]
37then
38 PARENT=`dirname \`which java\``
39 TESTJAVA=`dirname ${PARENT}`
40 echo "TESTJAVA not set, selecting " ${TESTJAVA}
41 echo "If this is incorrect, try setting the variable manually."
42fi
43
44if [ "${TESTCLASSES}" = "" ]
45then
46 echo "TESTCLASSES not set. Test cannot execute. Failed."
47 exit 1
48fi
49
50# set platform-dependent variables
51OS=`uname -s`
52case "$OS" in
53 SunOS | Linux )
54 FS="/"
55 RM=/bin/rm
56 CP=/bin/cp
57 MV=/bin/mv
58 ;;
59 Windows_* )
60 FS="\\"
61 RM=rm
62 CP=cp
63 MV=mv
64 ;;
65 * )
66 echo "Unrecognized system!"
67 exit 1;
68 ;;
69esac
70
71
72JAVA=${TESTJAVA}${FS}bin${FS}java
73
74# Don't test debug builds, they do read the config files:
75${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "debug" >/dev/null
76if [ "$?" = "0" ]; then
77 echo Skipping test for debug build.
78 exit 0
79fi
80
81ok=yes
82
83$RM -f .hotspot_compiler .hotspotrc
84
85${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
86if [ "$?" = "0" ]; then
87 echo "FAILED: base case failure"
88 exit 1
89fi
90
91
92echo "garbage in, garbage out" > .hotspot_compiler
93${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
94if [ "$?" = "0" ]; then
95 echo "FAILED: .hotspot_compiler was read"
96 ok=no
97fi
98
99$MV .hotspot_compiler hs_comp.txt
100${JAVA} ${TESTVMOPTS} -XX:CompileCommandFile=hs_comp.txt -version 2>&1 | grep "garbage in" >/dev/null
101if [ "$?" = "1" ]; then
102 echo "FAILED: explicit compiler command file not read"
103 ok=no
104fi
105
106$RM -f .hotspot_compiler hs_comp.txt
107
108echo "garbage" > .hotspotrc
109${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage" >/dev/null
110if [ "$?" = "0" ]; then
111 echo "FAILED: .hotspotrc was read"
112 ok=no
113fi
114
115$MV .hotspotrc hs_flags.txt
116${JAVA} ${TESTVMOPTS} -XX:Flags=hs_flags.txt -version 2>&1 | grep "garbage" >/dev/null
117if [ "$?" = "1" ]; then
118 echo "FAILED: explicit flags file not read"
119 ok=no
120fi
121
122if [ "${ok}" = "no" ]; then
123 echo "Some tests failed."
124 exit 1
125else
126 echo "Passed"
127 exit 0
128fi
129
Note: See TracBrowser for help on using the repository browser.