small changes
[c11tester.git] / run.sh
diff --git a/run.sh b/run.sh
index c8dbeb46066c452d0c83260de684fdaf4e1eadf0..0807b2ec4a4557a05691c0f6a3315571f4b2681b 100755 (executable)
--- a/run.sh
+++ b/run.sh
 # default program.
 #
 
-BIN=./test/userprog.o
+# Get the directory in which this script and the binaries are located
+BINDIR="${0%/*}"
+
+BIN=${BINDIR}/test/userprog.o
 PREFIX=
 
-export LD_LIBRARY_PATH=.
+export LD_LIBRARY_PATH=${BINDIR}
+# For Mac OSX
+export DYLD_LIBRARY_PATH=${BINDIR}
 
 [ $# -gt 0 ] && [ "$1" = "gdb" ] && PREFIX=gdb && shift
-[ $# -gt 0 ] && [ -x "$1" ] && [ -f "$1" ] && BIN="$1" && shift
+[ $# -gt 0 ] && [ -e "$1" ] && BIN="$1" && shift
 
+set -xe
 $PREFIX $BIN $@