1#!/bin/sh 2 3# 4# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 5# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6# 7# This code is free software; you can redistribute it and/or modify it 8# under the terms of the GNU General Public License version 2 only, as 9# published by the Free Software Foundation. 10# 11# This code is distributed in the hope that it will be useful, but WITHOUT 12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14# version 2 for more details (a copy is included in the LICENSE file that 15# accompanied this code). 16# 17# You should have received a copy of the GNU General Public License version 18# 2 along with this work; if not, write to the Free Software Foundation, 19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20# 21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22# or visit www.oracle.com if you need additional information or have any 23# questions. 24# 25 26# 27# @test 28# @bug 4940642 29# @summary Check for -help and -X flags 30# @author Martin Buchholz 31# 32# @run shell Help.sh 33 34# To run this test manually, simply do ./MineField.sh 35 36 37. ${TESTSRC-.}/Util.sh 38 39set -u 40 41DiagnosticsInEnglishPlease 42 43HELP="`\"$javac\" ${TESTTOOLVMOPTS} -help 2>&1`" 44XHELP="`\"$javac\" ${TESTTOOLVMOPTS} -X 2>&1`" 45 46#---------------------------------------------------------------- 47# Standard options 48#---------------------------------------------------------------- 49for opt in \ 50 "-X " \ 51 "-J" \ 52 "-classpath " \ 53 "-cp " \ 54 "-bootclasspath " \ 55 "-sourcepath "; 56do 57 case "$HELP" in *"$opt"*) ;; *) Fail "Bad help output" ;; esac 58done 59 60#---------------------------------------------------------------- 61# Non-standard options 62#---------------------------------------------------------------- 63for opt in \ 64 "-Xbootclasspath/p:"; 65do 66 case "$XHELP" in *"$opt"*) ;; *) Fail "Bad help output" ;; esac 67done 68 69Bottom Line 70