test/compiler/6894807/Test6894807.sh

Print this page


   1 #!/bin/sh
   2 
   3 if [ "${TESTSRC}" = "" ]
   4 then TESTSRC=.
   5 fi
   6 
   7 if [ "${TESTJAVA}" = "" ]
   8 then
   9   PARENT=`dirname \`which java\``
  10   TESTJAVA=`dirname ${PARENT}`
  11   echo "TESTJAVA not set, selecting " ${TESTJAVA}
  12   echo "If this is incorrect, try setting the variable manually."
  13 fi
  14 
  15 if [ "${TESTCLASSES}" = "" ]
  16 then
  17   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  18   exit 1
  19 fi
  20 
  21 BIT_FLAG=""
  22 
  23 # set platform-dependent variables
  24 OS=`uname -s`
  25 case "$OS" in
  26   SunOS | Linux )
  27     NULL=/dev/null
  28     PS=":"
  29     FS="/"
  30     ## for solaris, linux it's HOME
  31     FILE_LOCATION=$HOME
  32     if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
  33     then
  34         BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT | grep -v '^#'`
  35     fi
  36     ;;
  37   Windows_* )
  38     NULL=NUL
  39     PS=";"
  40     FS="\\"
  41     ;;
  42   * )
  43     echo "Unrecognized system!"
  44     exit 1;
  45     ;;
  46 esac
  47 
  48 JEMMYPATH=${CPAPPEND}
  49 CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
  50 
  51 THIS_DIR=`pwd`
  52 
  53 ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -version
  54 
  55 ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -server IsInstanceTest > test.out 2>&1
  56 
  57 cat test.out
  58 
  59 grep "Failed at index" test.out
  60 
  61 if [ $? = 0 ]
  62 then
  63     echo "Test Failed"
  64     exit 1
  65 else
  66     echo "Test Passed"
  67     exit 0
  68 fi
   1 #!/bin/sh
   2 
   3 if [ "${TESTSRC}" = "" ]
   4 then TESTSRC=.
   5 fi
   6 
   7 if [ "${TESTJAVA}" = "" ]
   8 then
   9   PARENT=`dirname \`which java\``
  10   TESTJAVA=`dirname ${PARENT}`
  11   echo "TESTJAVA not set, selecting " ${TESTJAVA}
  12   echo "If this is incorrect, try setting the variable manually."
  13 fi
  14 
  15 if [ "${TESTCLASSES}" = "" ]
  16 then
  17   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  18   exit 1
  19 fi
  20 


  21 # set platform-dependent variables
  22 OS=`uname -s`
  23 case "$OS" in
  24   SunOS | Linux )
  25     NULL=/dev/null
  26     PS=":"
  27     FS="/"






  28     ;;
  29   Windows_* )
  30     NULL=NUL
  31     PS=";"
  32     FS="\\"
  33     ;;
  34   * )
  35     echo "Unrecognized system!"
  36     exit 1;
  37     ;;
  38 esac
  39 
  40 JEMMYPATH=${CPAPPEND}
  41 CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
  42 
  43 THIS_DIR=`pwd`
  44 
  45 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version
  46 
  47 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -server IsInstanceTest > test.out 2>&1
  48 
  49 cat test.out
  50 
  51 grep "Failed at index" test.out
  52 
  53 if [ $? = 0 ]
  54 then
  55     echo "Test Failed"
  56     exit 1
  57 else
  58     echo "Test Passed"
  59     exit 0
  60 fi