public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/5] lib/tests: fix tests and test list location
@ 2014-11-03 11:31 Thomas Wood
  2014-11-03 11:31 ` [PATCH i-g-t 2/5] lib/tests: don't use hard error status to indicate test failure Thomas Wood
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Thomas Wood @ 2014-11-03 11:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

The igt_command_line.sh script was moved by commit 685e577 (Move library
selftests to lib/tests), but the location of the tests and the test
lists was not updated.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/tests/Makefile.am         |  4 ++++
 lib/tests/igt_command_line.sh | 18 ++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
index 78279fb..bab0fcb 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 075f1d5..7e6ca67 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:"
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-11-03 16:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 11:31 [PATCH i-g-t 1/5] lib/tests: fix tests and test list location Thomas Wood
2014-11-03 11:31 ` [PATCH i-g-t 2/5] lib/tests: don't use hard error status to indicate test failure Thomas Wood
2014-11-03 15:02   ` Daniel Vetter
2014-11-03 15:42     ` Thomas Wood
2014-11-03 16:44       ` Daniel Vetter
2014-11-03 11:31 ` [PATCH i-g-t 3/5] testdisplay: ensure invalid long option exit status is non-zero Thomas Wood
2014-11-03 11:31 ` [PATCH i-g-t 4/5] testdiplay: add a "--help" option Thomas Wood
2014-11-03 11:31 ` [PATCH i-g-t 5/5] configure: fix issues when running outside the source tree Thomas Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox