docs: move to subdirectory
[c11tester.git] / run.sh
1 #!/bin/sh
2 #
3 # Runs a simple test (default: ./test/userprog.o)
4 # Syntax:
5 #  ./run.sh [gdb]
6 #  ./run.sh [test program] [gdb]
7 #
8 # If you include a 'gdb' argument, the your program will be launched with gdb.
9 # You can also supply a test program argument to run something besides the
10 # default program.
11 #
12
13 BIN=./test/userprog.o
14
15 export LD_LIBRARY_PATH=.
16
17 [ $# -gt 0 ] && [ "$1" != "gdb" ] && BIN=$1 && shift
18
19 if [ $# -gt 0 ] && [ "$1" = "gdb" ]; then
20         shift
21         gdb $BIN $@
22 fi
23
24 $BIN $@