Print this page
rev 4503 : 8009152: A number of jtreg tests need review/improvement
Summary: Added a new test_env.txt file to capture common shell variable. Added concept of COMPILEJAVA for use when TESTJAVA is a JRE. If COMPILEJAVA not set then TESTJAVA will be the default with assumption it is a JDK.
Reviewed-by: kvn, brutisso, coleenp

Split Split Close
Expand all
Collapse all
          --- old/test/runtime/7162488/Test7162488.sh
          +++ new/test/runtime/7162488/Test7162488.sh
↓ open down ↓ 21 lines elided ↑ open up ↑
  22   22  #
  23   23  
  24   24  
  25   25  # @test Test7162488.sh
  26   26  # @bug 7162488
  27   27  # @summary VM not printing unknown -XX options
  28   28  # @run shell Test7162488.sh
  29   29  #
  30   30  
  31   31  if [ "${TESTSRC}" = "" ]
  32      -  then TESTSRC=.
  33      -fi
  34      -
  35      -if [ "${TESTJAVA}" = "" ]
  36   32  then
  37      -  PARENT=`dirname \`which java\``
  38      -  TESTJAVA=`dirname ${PARENT}`
  39      -  printf "TESTJAVA not set, selecting " ${TESTJAVA}
  40      -  printf "  If this is incorrect, try setting the variable manually.\n"
       33 +  TESTSRC=${PWD}
       34 +  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
  41   35  fi
       36 +echo "TESTSRC=${TESTSRC}"
       37 +## Adding common setup Variables for running shell tests.
       38 +. ${TESTSRC}/../../test_env.sh
  42   39  
  43      -# set platform-dependent variables
  44      -OS=`uname -s`
  45      -case "$OS" in
  46      -  Windows_* )
  47      -    FS="\\"
  48      -    ;;
  49      -  * )
  50      -    FS="/"
  51      -    ;;
  52      -esac
  53      -
  54   40  JAVA=${TESTJAVA}${FS}bin${FS}java
  55   41  
  56   42  #
  57   43  # Just run with an option we are confident will not be recognized,
  58   44  # and check for the message:
  59   45  #
  60   46  OPTION=this_is_not_an_option
  61   47  
  62   48  ${JAVA} ${TESTVMOPTS} -showversion -XX:${OPTION} 2>&1 | grep "Unrecognized VM option" 
  63   49  if [ "$?" != "0" ]
↓ open down ↓ 14 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX