#!/bin/bash
if [ -z "$TIMELIMIT" ]; then
  TIMELIMIT=5
fi
echo -n .
( ulimit -t $TIMELIMIT; $1/bin/jstar -f $2.jimple ) 2> /dev/null
EC=$?
case $EC in
  137)
    echo
    echo "Time limit (${TIMELIMIT}s) exceeded. Try"
    echo "  TIMELIMIT=${TIMELIMIT}0 make test"
    echo "(or some other number >$TIMELIMIT)."
    ;;
  0)
    ;;
  *)
    echo 
    echo "Failed $2 in $(pwd) (errorcode $EC)"
    ;;
esac


#!/bin/bash
if [ -z "$TIMELIMIT" ]; then
  TIMELIMIT=5
fi
echo -n .
( $1/unit_tests/limit -w $TIMELIMIT -x "$1/bin/jstar -f $2.jimple" ) 2> /dev/null
EC=$?
case $EC in
  4)
    echo
    echo "Time limit (${TIMELIMIT}s) exceeded. Try"
    echo "  TIMELIMIT=${TIMELIMIT}0 make test"
    echo "or, if you use a byte-code build,"
    echo "  TIMELIMIT=${TIMELIMIT}0 make test-byte"
    echo "(or some other number >$TIMELIMIT)."
    ;;
  0)
    ;;
  *)
    echo 
    echo "Failed $2 in $(pwd) (errorcode $EC)"
    ;;
esac


Use Radu's limit rather than ulimit
Use Radu's limit rather than ulimit
