summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tests/Makefile.am4
-rwxr-xr-xlib/tests/igt_command_line.sh18
2 files changed, 16 insertions, 6 deletions
diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
index 78279fb4..bab0fcb6 100644
--- a/lib/tests/Makefile.am
+++ b/lib/tests/Makefile.am
@@ -1,5 +1,9 @@
include Makefile.sources
+AM_TESTS_ENVIRONMENT = \
+ top_builddir=$(top_builddir) \
+ top_srcdir=$(top_srcdir)
+
EXTRA_DIST = $(check_SCRIPTS)
AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \
diff --git a/lib/tests/igt_command_line.sh b/lib/tests/igt_command_line.sh
index 075f1d53..7e6ca67f 100755
--- a/lib/tests/igt_command_line.sh
+++ b/lib/tests/igt_command_line.sh
@@ -25,17 +25,23 @@
# Check that command line handling works consistently across all tests
#
-for test in `cat single-tests.txt multi-tests.txt`; do
+TESTLIST=`cat $top_builddir/tests/single-tests.txt $top_builddir/tests/multi-tests.txt`
+if [ $? -ne 0 ]; then
+ echo "Error: Could not read test lists"
+ exit 99
+fi
+
+for test in $TESTLIST; do
if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then
continue
fi
- # if the test is a script, it will be in $srcdir
- if [ ! -x $test ]; then
- if [ -x $srcdir/$test ]; then
- test=$srcdir/$test
- fi
+ if [ -x $top_builddir/tests/$test ]; then
+ test=$top_builddir/tests/$test
+ else
+ # if the test is a script, it will be in $srcdir
+ test=$top_srcdir/tests/$test
fi
echo "$test:"