X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=run.sh;h=c8dbeb46066c452d0c83260de684fdaf4e1eadf0;hp=9c7af2fb5f4e9bd1283d22975cf6b9c020ae8afe;hb=4159ba45e83f6542e3a3320e83bca9fbaf2da3ea;hpb=8cc80ac1e6bcacda869efce26b2cc58c7b2a6685 diff --git a/run.sh b/run.sh index 9c7af2fb..c8dbeb46 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,22 @@ #!/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 + +$PREFIX $BIN $@