Make tests/*.sh runnable from anywhere
diff --git a/tests/compat.sh b/tests/compat.sh
index cd55d05..554adef 100755
--- a/tests/compat.sh
+++ b/tests/compat.sh
@@ -955,6 +955,11 @@
 # MAIN
 #
 
+if cd $( dirname $0 ); then :; else
+    echo "cd $( dirname $0 ) failed" >&2
+    exit 1
+fi
+
 get_options "$@"
 
 # sanity checks, avoid an avalanche of errors