6 echo "usage: $0 <timeout> <program> <args...>"
8 echo " This script simply runs another program under ulimit and always"
9 echo " returns true. It is used for invoking tools from the LLVM test suite"
10 echo " Makefiles, where we need them to always return true so that we don't"
11 echo " abort the test run."
15 # Save a copy of the original arguments in a string before we
16 # clobber them with the shift command.
29 # Disable core file emission, the script doesn't find it anyway because it
31 ULIMITCMD
="$ULIMITCMD ulimit -c 0;"
32 ULIMITCMD
="$ULIMITCMD ulimit -t $TIMEOUT;"
33 # To prevent infinite loops which fill up the disk, specify a limit on size
34 # of files being output by the tests. 10 MB should be enough for anybody. ;)
35 ULIMITCMD
="$ULIMITCMD ulimit -f 10485760;"
38 ULIMITCMD
="$ULIMITCMD ulimit -t $TIMEOUT;"
39 ULIMITCMD
="$ULIMITCMD ulimit -c unlimited;"
40 # To prevent infinite loops which fill up the disk, specify a limit on size
41 # of files being output by the tests. 10 MB should be enough for anybody. ;)
42 ULIMITCMD
="$ULIMITCMD ulimit -f 10485760;"
44 # virtual memory: 600 MB should be enough for anybody. ;)
45 ULIMITCMD
="$ULIMITCMD ulimit -v 600000;"
48 if ( ! sh
-c "$ULIMITCMD sh -c '$PROGRAM $*'" ); then
49 echo "warning: command failed: '$PROGRAM $*'"
52 # Always return "successful" so that tests will continue to be run.