run.sh: fixup run script
authorBrian Norris <banorris@uci.edu>
Thu, 2 Aug 2012 23:37:03 +0000 (16:37 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 2 Aug 2012 23:40:02 +0000 (16:40 -0700)
run.sh will, by default, run ./test/userprog.o now. This can be modified later
to provide several regression tests in-tree, with scripted execution of the
tests.

run.sh

diff --git a/run.sh b/run.sh
index 7ef8e9b..fecd43d 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -1,13 +1,28 @@
 #!/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=.
 
+[ $# -gt 0 ] && [ "$1" != "gdb" ] && BIN=$1 && shift
+
 if [ $# -gt 0 ]; then
        if [ "$1" = "gdb" ]; then
-               gdb ./model
+               gdb $BIN
        else
                echo "Invalid argument(s)"
                exit 1
        fi
 else
-       ./model
+       $BIN
 fi