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