1 #!/bin/sh
   2 
   3 #
   4 # Copyright (c) 2003, 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 
  39 set -u
  40 
  41 DiagnosticsInEnglishPlease
  42 
  43 HELP="`\"$javac\" ${TESTTOOLVMOPTS} -help 2>&1`"
  44 XHELP="`\"$javac\" ${TESTTOOLVMOPTS} -X 2>&1`"
  45 
  46 #----------------------------------------------------------------
  47 # Standard options
  48 #----------------------------------------------------------------
  49 for opt in \
  50     "-X " \
  51     "-J" \
  52     "-classpath " \
  53     "-cp " \
  54     "-bootclasspath " \
  55     "-sourcepath "; 
  56 do
  57     case "$HELP" in *"$opt"*) ;; *) Fail "Bad help output" ;; esac
  58 done
  59 
  60 #----------------------------------------------------------------
  61 # Non-standard options
  62 #----------------------------------------------------------------
  63 for opt in \
  64     "-Xbootclasspath/p:"; 
  65 do
  66     case "$XHELP" in *"$opt"*) ;; *) Fail "Bad help output" ;; esac
  67 done
  68 
  69 Bottom Line