X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=run.sh;h=00ffd94b338c223710f15198e06f1fd40ca25509;hb=d496f3fa3c31e7f2ed84a2e19e9c2b3993dca1a7;hp=8eaeb3d48e5a974cd778229623fb9eff2fd8c3ed;hpb=d8ca702e1a120bacb2d129242f72323d8afd129b;p=c11tester.git diff --git a/run.sh b/run.sh index 8eaeb3d4..00ffd94b 100755 --- a/run.sh +++ b/run.sh @@ -1,3 +1,23 @@ #!/bin/sh +# +# Runs a simple test (default: ./test/userprog.o) +# Syntax: +# ./run.sh [test program] [OPTIONS] +# ./run.sh [OPTIONS] +# ./run.sh [gdb [test program]] +# +# If you include a 'gdb' argument, the your program will be launched with gdb. +# You can also supply a test program argument to run something besides the +# default program. +# + +BIN=./test/userprog.o +PREFIX= + export LD_LIBRARY_PATH=. -./model + +[ $# -gt 0 ] && [ "$1" = "gdb" ] && PREFIX=gdb && shift +[ $# -gt 0 ] && [ -x "$1" ] && [ -f "$1" ] && BIN="$1" && shift + +set -x +$PREFIX $BIN $@