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     FILE_LOCATION=$HOME
  31     if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" -a `uname -p`='sparc' ]
  32     then
  33         BIT_FLAG="-d64"
  34     fi
  35     ;;
  36   Windows_* )
  37     NULL=NUL
  38     PS=";"
  39     FS="\\"
  40     ;;
  41   * )
  42     echo "Unrecognized system!"
  43     exit 1;
  44     ;;
  45 esac
  46 
  47 CLASSPATH=.${PS}${TESTCLASSES} ; export CLASSPATH
  48 
  49 ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -fullversion
  50 
  51 COUNT=1
  52 STATUS=0
  53 
  54 while [ $COUNT -le 5 ]
  55 do
  56     rm -f test.out compare.out
  57 
  58     ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -server CharArrTest > test.out 2>&1
  59 
  60     tail -3 test.out > compare.out
  61     
  62     diff ${TESTSRC}${FS}gold.txt compare.out > ${NULL} 2>&1
  63     if [ $? != 0 ]
  64     then
  65         STATUS=1
  66         break
  67     fi
  68  
  69     COUNT=`expr $COUNT + 1`
  70 done
  71 
  72 exit $STATUS