fix broken use of iterator
[satcheck.git] / run.sh
1 #!/bin/sh
2 #
3 # Runs a simple test (default: ./test/userprog.o)
4 # Syntax:
5 #  ./run.sh [test program] [OPTIONS]
6 #  ./run.sh [OPTIONS]
7 #  ./run.sh [gdb [test program]]
8 #
9 # If you include a 'gdb' argument, the your program will be launched with gdb.
10 # You can also supply a test program argument to run something besides the
11 # default program.
12 #
13
14 BIN=./test/userprog.o
15 PREFIX=
16
17 export LD_LIBRARY_PATH=.
18 # For Mac OSX
19 export DYLD_LIBRARY_PATH=.
20 export PATH=.:$PATH
21 [ $# -gt 0 ] && [ "$1" = "gdb" ] && PREFIX=gdb && shift
22 [ $# -gt 0 ] && [ "$1" = "apple" ] && PREFIX=gdb-apple && shift
23 [ $# -gt 0 ] && [ "$1" = "lldb" ] && PREFIX=lldb && shift
24 [ $# -gt 0 ] && [ -e "$1" ] && BIN="$1" && shift
25
26 set -xe
27 $PREFIX $BIN $@