#!/bin/sh
#
# Script to run a regression test with a time limit (in seconds)
# this allows the script to be killed if say the SD crashes
# due to an ASSERT.  Otherwise the script will hang for
# a very long time, perhaps forever.
#
# Of course, this implies that all tests must terminate normally
# within the timeout period (900 seconds).
#
if [ -f ${bin}/timelimit ]; then
   WARNTIME=900 KILLTIME=50 ${bin}/timelimit $*
   if [ $? != 0 ] ; then
      echo " "
      echo "=== Test $* timed out ==="
      echo " "
      echo " " >> test.out
      echo "=== Test $* timed out ===" >> test.out
      echo " " >> test.out
   fi
else
   nice $*
fi
#echo " "
#echo " "
#grep -e" \!\!\!\!" -e"===\ Test" test.out
