3494N/A#
3494N/A# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3494N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3494N/A#
3494N/A# This code is free software; you can redistribute it and/or modify it
3494N/A# under the terms of the GNU General Public License version 2 only, as
3494N/A# published by the Free Software Foundation.
3494N/A#
3494N/A# This code is distributed in the hope that it will be useful, but WITHOUT
3494N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3494N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3494N/A# version 2 for more details (a copy is included in the LICENSE file that
3494N/A# accompanied this code).
3494N/A#
3494N/A# You should have received a copy of the GNU General Public License version
3494N/A# 2 along with this work; if not, write to the Free Software Foundation,
3494N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3494N/A#
3494N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3494N/A# or visit www.oracle.com if you need additional information or have any
3494N/A# questions.
3494N/A#
3494N/A
3494N/A
3494N/A# @test Test7162488.sh
3494N/A# @bug 7162488
3494N/A# @summary VM not printing unknown -XX options
3494N/A# @run shell Test7162488.sh
3494N/A#
3494N/A
3494N/Aif [ "${TESTSRC}" = "" ]
3494N/Athen
4503N/A TESTSRC=${PWD}
4503N/A echo "TESTSRC not set. Using "${TESTSRC}" as default"
3494N/Afi
4503N/Aecho "TESTSRC=${TESTSRC}"
4503N/A## Adding common setup Variables for running shell tests.
4503N/A. ${TESTSRC}/../../test_env.sh
3494N/A
3494N/AJAVA=${TESTJAVA}${FS}bin${FS}java
3494N/A
3494N/A#
3494N/A# Just run with an option we are confident will not be recognized,
3494N/A# and check for the message:
3494N/A#
3494N/AOPTION=this_is_not_an_option
3494N/A
3494N/A${JAVA} ${TESTVMOPTS} -showversion -XX:${OPTION} 2>&1 | grep "Unrecognized VM option"
3494N/Aif [ "$?" != "0" ]
3494N/Athen
3494N/A printf "FAILED: option not flagged as unrecognized.\n"
3494N/A exit 1
3494N/Afi
3494N/A
3494N/A${JAVA} ${TESTVMOPTS} -showversion -XX:${OPTION} 2>&1 | grep ${OPTION}
3494N/Aif [ "$?" != "0" ]
3494N/Athen
3494N/A printf "FAILED: bad option not named as being bad.\n"
3494N/A exit 1
3494N/Afi
3494N/A
3494N/Aprintf "Passed.\n"
3494N/A