test/runtime/7162488/Test7162488.sh

Thu, 13 Dec 2012 09:05:20 -0800

author
katleman
date
Thu, 13 Dec 2012 09:05:20 -0800
changeset 4331
8af7d22f1f8f
parent 3721
f3a4ee95783b
child 4831
04d6d4322c6a
permissions
-rw-r--r--

Added tag jdk8-b68 for changeset 121aa71316af

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

mercurial