diff --git a/autotest.sh b/autotest.sh
index 83a20699d0162befae329a54d8ee9c4a2dcdc471..abed4a8908a3eef69a5f2f4479d0dc717280c4f1 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -227,7 +227,11 @@ if [ -z "$1" ]
 		execute_tests $DBCONFIG
 	done
 else
-	execute_tests "$1" "$2" "$3"
+	FILENAME="$2"
+	if [ ! -f "tests/$FILENAME" ]; then
+		FILENAME="../$FILENAME"
+	fi
+	execute_tests "$1" "$FILENAME" "$3"
 fi
 
 cd "$BASEDIR"