TestFieldMonitor.sh 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/bin/sh

if [ "${TESTSRC}" = "" ]
then TESTSRC=.
fi

if [ "${TESTJAVA}" = "" ]
then
  PARENT=`dirname \`which java\``
  TESTJAVA=`dirname ${PARENT}`
  echo "TESTJAVA not set, selecting " ${TESTJAVA}
  echo "If this is incorrect, try setting the variable manually."
fi

if [ "${TESTCLASSES}" = "" ]
then
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  exit 1
fi

# set platform-dependent variables
OS=`uname -s`
case "$OS" in
24
  SunOS | Linux | Darwin)
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
    NULL=/dev/null
    PS=":"
    FS="/"
    ;;
  Windows_95 | Windows_98 | Windows_ME )
    NULL=NUL
    PS=";"
    FS="\\"
    echo "Test skipped, only for WinNT"
    exit 0
    ;;
  Windows_NT )
    NULL=NUL
    PS=";"
    FS="\\"
    ;;
  * )
    echo "Unrecognized system!"
    exit 1;
    ;;
esac

#CLASSPATH=.${PS}${TESTCLASSES} ; export CLASSPATH

cp ${TESTSRC}${FS}*.java .

51
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion
52 53 54

${TESTJAVA}${FS}bin${FS}javac -classpath .${PS}$TESTJAVA${FS}lib${FS}tools.jar *.java

55
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath .${PS}$TESTJAVA${FS}lib${FS}tools.jar FieldMonitor > test.out
56 57 58 59 60 61 62 63

grep "A fatal error has been detected" test.out > ${NULL}
if [ $? = 0 ]; then
    cat test.out
    STATUS=1
fi

exit $STATUS