X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=run.sh;h=d4bf03000c92d6ab01f39b0e4cd14a17643f091f;hp=9fc6f8925aa867d51afa2d602185b0f3975e9352;hb=ec80014245d22f726e4d66a89b6bd6d293db177c;hpb=6a3cefc5fc5bcae7b7f94dd9e6199f6b3efdd76e diff --git a/run.sh b/run.sh index 9fc6f892..d4bf0300 100755 --- a/run.sh +++ b/run.sh @@ -1,3 +1,24 @@ #!/bin/sh +# +# Runs a simple test (default: ./test/userprog.o) +# Syntax: +# ./run.sh [gdb] +# ./run.sh [test program] [gdb] +# +# 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 + export LD_LIBRARY_PATH=. -gdb ./model + +[ $# -gt 0 ] && [ "$1" != "gdb" ] && BIN=$1 && shift + +if [ $# -gt 0 ] && [ "$1" = "gdb" ]; then + shift + gdb $BIN $@ +fi + +$BIN $@