Print this page
rev 4503 : 8009152: A number of jtreg tests need review/improvement
Summary: Added a new test_env.txt file to capture common shell variable. Added concept of COMPILEJAVA for use when TESTJAVA is a JRE. If COMPILEJAVA not set then TESTJAVA will be the default with assumption it is a JDK.
Reviewed-by: kvn, brutisso, coleenp
Split |
Split |
Close |
Expand all |
Collapse all |
--- old/test/runtime/7162488/Test7162488.sh
+++ new/test/runtime/7162488/Test7162488.sh
1 1 #
2 2 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 #
5 5 # This code is free software; you can redistribute it and/or modify it
6 6 # under the terms of the GNU General Public License version 2 only, as
7 7 # published by the Free Software Foundation.
8 8 #
9 9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 # version 2 for more details (a copy is included in the LICENSE file that
13 13 # accompanied this code).
14 14 #
15 15 # You should have received a copy of the GNU General Public License version
16 16 # 2 along with this work; if not, write to the Free Software Foundation,
17 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 #
19 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 20 # or visit www.oracle.com if you need additional information or have any
21 21 # questions.
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
22 22 #
23 23
24 24
25 25 # @test Test7162488.sh
26 26 # @bug 7162488
27 27 # @summary VM not printing unknown -XX options
28 28 # @run shell Test7162488.sh
29 29 #
30 30
31 31 if [ "${TESTSRC}" = "" ]
32 - then TESTSRC=.
33 -fi
34 -
35 -if [ "${TESTJAVA}" = "" ]
36 32 then
37 - PARENT=`dirname \`which java\``
38 - TESTJAVA=`dirname ${PARENT}`
39 - printf "TESTJAVA not set, selecting " ${TESTJAVA}
40 - printf " If this is incorrect, try setting the variable manually.\n"
33 + TESTSRC=${PWD}
34 + echo "TESTSRC not set. Using "${TESTSRC}" as default"
41 35 fi
36 +echo "TESTSRC=${TESTSRC}"
37 +## Adding common setup Variables for running shell tests.
38 +. ${TESTSRC}/../../test_env.sh
42 39
43 -# set platform-dependent variables
44 -OS=`uname -s`
45 -case "$OS" in
46 - Windows_* )
47 - FS="\\"
48 - ;;
49 - * )
50 - FS="/"
51 - ;;
52 -esac
53 -
54 40 JAVA=${TESTJAVA}${FS}bin${FS}java
55 41
56 42 #
57 43 # Just run with an option we are confident will not be recognized,
58 44 # and check for the message:
59 45 #
60 46 OPTION=this_is_not_an_option
61 47
62 48 ${JAVA} ${TESTVMOPTS} -showversion -XX:${OPTION} 2>&1 | grep "Unrecognized VM option"
63 49 if [ "$?" != "0" ]
64 50 then
65 51 printf "FAILED: option not flagged as unrecognized.\n"
66 52 exit 1
67 53 fi
68 54
69 55 ${JAVA} ${TESTVMOPTS} -showversion -XX:${OPTION} 2>&1 | grep ${OPTION}
70 56 if [ "$?" != "0" ]
71 57 then
72 58 printf "FAILED: bad option not named as being bad.\n"
73 59 exit 1
74 60 fi
75 61
76 62 printf "Passed.\n"
77 63
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX