All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built.
@ 2016-04-29 13:11 Marius Vlad
  2016-04-29 13:11 ` [PATCH i-g-t 2/2] autotools, assembler: Fix check target for tests in assembler Marius Vlad
  2016-08-24  8:43 ` [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Marius Vlad @ 2016-04-29 13:11 UTC (permalink / raw)
  To: intel-gfx

We need to have the test list generated before running the check target.
Migrated igt_command_line.sh to tests/ from lib/tests/, which allows to
building the tests and execute the script.

This would allow cleaning followed by a make check.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
---
 lib/tests/Makefile.am         |  1 -
 lib/tests/Makefile.sources    |  3 --
 lib/tests/igt_command_line.sh | 76 -------------------------------------------
 tests/Makefile.am             |  2 +-
 tests/Makefile.sources        |  8 +++++
 tests/igt_command_line.sh     | 74 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 83 insertions(+), 81 deletions(-)
 delete mode 100755 lib/tests/igt_command_line.sh
 create mode 100755 tests/igt_command_line.sh

diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
index 582cc3e..99ab724 100644
--- a/lib/tests/Makefile.am
+++ b/lib/tests/Makefile.am
@@ -4,7 +4,6 @@ AM_TESTS_ENVIRONMENT = \
 	top_builddir=$(top_builddir) \
 	top_srcdir=$(top_srcdir)
 
-EXTRA_DIST = $(check_SCRIPTS)
 
 AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \
 	-I$(srcdir)/../.. \
diff --git a/lib/tests/Makefile.sources b/lib/tests/Makefile.sources
index 707c445..37126f1 100644
--- a/lib/tests/Makefile.sources
+++ b/lib/tests/Makefile.sources
@@ -15,9 +15,6 @@ check_PROGRAMS = \
 	igt_exit_handler \
 	$(NULL)
 
-check_SCRIPTS = \
-	igt_command_line.sh \
-	$(NULL)
 
 TESTS = \
 	$(check_PROGRAMS) \
diff --git a/lib/tests/igt_command_line.sh b/lib/tests/igt_command_line.sh
deleted file mode 100755
index e83a548..0000000
--- a/lib/tests/igt_command_line.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-#
-# Copyright © 2014 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-
-#
-# Check that command line handling works consistently across all tests
-#
-
-TESTLIST=`cat $top_builddir/tests/test-list.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 [ -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:"
-
-	# check invalid option handling
-	echo "  Checking invalid option handling..."
-	./$test --invalid-option 2> /dev/null && exit 1
-
-	# check valid options succeed
-	echo "  Checking valid option handling..."
-	./$test --help > /dev/null || exit 1
-
-	# check --list-subtests works correctly
-	echo "  Checking subtest enumeration..."
-	LIST=`./$test --list-subtests`
-	RET=$?
-	if [ $RET -ne 0 -a $RET -ne 79 ]; then
-		exit 1
-	fi
-
-	if [ $RET -eq 79 -a -n "$LIST" ]; then
-		exit 1
-	fi
-
-	if [ $RET -eq 0 -a -z "$LIST" ]; then
-		exit 1
-	fi
-
-	# check invalid subtest handling
-	echo "  Checking invalid subtest handling..."
-	./$test --run-subtest invalid-subtest > /dev/null 2>&1 && exit 1
-done
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 45e3359..79a7324 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -49,7 +49,7 @@ all-local: .gitignore
 pkgdata_DATA = test-list.txt test-list-full.txt
 
 EXTRA_PROGRAMS = $(HANG)
-EXTRA_DIST = $(common_files)
+EXTRA_DIST = $(common_files) $(check_SCRIPTS)
 
 CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt test-list-full.txt .gitignore
 
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index b73f48d..28e8695 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -287,6 +287,14 @@ testdisplay_SOURCES = \
 
 TESTS_progs += testdisplay
 
+check_SCRIPTS = \
+		igt_command_line.sh \
+		$(NULL)
+
+TESTS = \
+	$(check_SCRIPTS) \
+	$(NULL)
+
 common_files = \
 	       eviction_common.c \
 	       $(NULL)
diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
new file mode 100755
index 0000000..fd09981
--- /dev/null
+++ b/tests/igt_command_line.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# Copyright © 2014 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+#
+# Check that command line handling works consistently across all tests
+#
+
+TESTLIST=`cat test-list.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
+
+	# make distcheck happy
+	if [ ! -x "$test" ]; then
+		continue
+	fi
+
+	echo "$test:"
+
+	# check invalid option handling
+	echo "  Checking invalid option handling..."
+	./$test --invalid-option 2> /dev/null && exit 1
+
+	# check valid options succeed
+	echo "  Checking valid option handling..."
+	./$test --help > /dev/null || exit 1
+
+	# check --list-subtests works correctly
+	echo "  Checking subtest enumeration..."
+	LIST=`./$test --list-subtests`
+	RET=$?
+	if [ $RET -ne 0 -a $RET -ne 79 ]; then
+		exit 1
+	fi
+
+	if [ $RET -eq 79 -a -n "$LIST" ]; then
+		exit 1
+	fi
+
+	if [ $RET -eq 0 -a -z "$LIST" ]; then
+		exit 1
+	fi
+
+	# check invalid subtest handling
+	echo "  Checking invalid subtest handling..."
+	./$test --run-subtest invalid-subtest > /dev/null 2>&1 && exit 1
+done
-- 
2.8.0.rc3

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

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

* [PATCH i-g-t 2/2] autotools, assembler: Fix check target for tests in assembler.
  2016-04-29 13:11 [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built Marius Vlad
@ 2016-04-29 13:11 ` Marius Vlad
  2016-08-24  8:43 ` [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Marius Vlad @ 2016-04-29 13:11 UTC (permalink / raw)
  To: intel-gfx

assembler suffers from the same issue as lib/tests, adjust it so
it allows us to do a check. Have to make autotools happy by having
an empty Makefile.am.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
---
 assembler/Makefile.am      | 108 ++++++++++++++++++++++++++++++++++++++++++++-
 assembler/test/Makefile.am |  93 --------------------------------------
 assembler/test/run-test.sh |   2 +-
 3 files changed, 107 insertions(+), 96 deletions(-)

diff --git a/assembler/Makefile.am b/assembler/Makefile.am
index fb309ac..bed6c07 100644
--- a/assembler/Makefile.am
+++ b/assembler/Makefile.am
@@ -47,8 +47,112 @@ intel_gen4disasm_LDADD = libbrw.la
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = intel-gen4asm.pc
 
-CLEANFILES = $(BUILT_SOURCES)
+check_SCRIPTS = test/run-test.sh
+
+TESTS = \
+	test/mov \
+	test/frc \
+	test/rndd \
+	test/rndu \
+	test/rnde \
+	test/rnde-intsrc \
+	test/rndz \
+	test/lzd \
+	test/not \
+	test/immediate \
+	$(NULL)
+
+# Tests that are expected to fail because they contain some inccorect code.
+XFAIL_TESTS =
+
+# Those tests were already failing when the assembler was imported from
+# the intel-gen4asm git repository:
+#   http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
+# We disable them "for now" as a workaround to be able to release i-g-t
+disabled_tests = \
+	test/declare \
+	test/jmpi \
+	test/if \
+	test/iff \
+	test/while \
+	test/else \
+	test/break \
+	test/cont \
+	test/halt \
+	test/wait \
+	test/endif \
+	$(NULL)
+
+disabled_xfail_tests = \
+	test/rnde-intsrc \
+	$(NULL)
+
+TESTDATA = \
+	test/mov.expected \
+	test/mov.g4a \
+	test/frc.expected \
+	test/frc.g4a \
+	test/rndd.expected \
+	test/rndd.g4a \
+	test/rndu.expected \
+	test/rndu.g4a \
+	test/rnde.expected \
+	test/rnde.g4a \
+	test/rnde-intsrc.expected \
+	test/rnde-intsrc.g4a \
+	test/rndz.expected \
+	test/rndz.g4a \
+	test/lzd.expected \
+	test/lzd.g4a \
+	test/not.expected \
+	test/not.g4a \
+	test/jmpi.expected \
+	test/jmpi.g4a \
+	test/if.expected \
+	test/if.g4a \
+	test/iff.expected \
+	test/iff.g4a \
+	test/while.expected \
+	test/while.g4a \
+	test/else.expected \
+	test/else.g4a \
+	test/break.expected \
+	test/break.g4a \
+	test/cont.expected \
+	test/cont.g4a \
+	test/halt.expected \
+	test/halt.g4a \
+	test/wait.expected \
+	test/wait.g4a \
+	test/endif.expected \
+	test/endif.g4a \
+	test/declare.expected \
+	test/declare.g4a \
+	test/immediate.g4a \
+	test/immediate.expected \
+	$(NULL)
+
+test_EXTRA_DIST = \
+	${TESTDATA} \
+	test/run-test.sh \
+	$(NULL)
+
+$(TESTS): test/run-test.sh
+	sed "s|TEST|$@|g" ${srcdir}/test/run-test.sh > $@
+	chmod +x $@
+
+test_CLEANFILES = \
+	test/*.out \
+	${TESTS} \
+	$(NULL)
+
+CLEANFILES = $(BUILT_SOURCES) \
+	     $(test_CLEANFILES) \
+	     $(NULL)
+
 EXTRA_DIST = \
 	README \
 	TODO \
-	intel-gen4asm.pc.in
+	intel-gen4asm.pc.in \
+	$(test_EXTRA_DIST) \
+	$(NULL)
diff --git a/assembler/test/Makefile.am b/assembler/test/Makefile.am
index f113119..e69de29 100644
--- a/assembler/test/Makefile.am
+++ b/assembler/test/Makefile.am
@@ -1,93 +0,0 @@
-check_SCRIPTS = run-test.sh
-
-TESTS_ENVIRONMENT = top_builddir=${top_builddir}
-TESTS = \
-	mov \
-	frc \
-	rndd \
-	rndu \
-	rnde \
-	rnde-intsrc \
-	rndz \
-	lzd \
-	not \
-	immediate
-
-# Tests that are expected to fail because they contain some inccorect code.
-XFAIL_TESTS =
-
-# Those tests were already failing when the assembler was imported from
-# the intel-gen4asm git repository:
-#   http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
-# We disable them "for now" as a workaround to be able to release i-g-t
-disabled_tests = \
-	declare \
-	jmpi \
-	if \
-	iff \
-	while \
-	else \
-	break \
-	cont \
-	halt \
-	wait \
-	endif
-
-disabled_xfail_tests = \
-	rnde-intsrc
-
-TESTDATA = \
-	mov.expected \
-	mov.g4a \
-	frc.expected \
-	frc.g4a \
-	rndd.expected \
-	rndd.g4a \
-	rndu.expected \
-	rndu.g4a \
-	rnde.expected \
-	rnde.g4a \
-	rnde-intsrc.expected \
-	rnde-intsrc.g4a \
-	rndz.expected \
-	rndz.g4a \
-	lzd.expected \
-	lzd.g4a \
-	not.expected \
-	not.g4a \
-	jmpi.expected \
-	jmpi.g4a \
-	if.expected \
-	if.g4a \
-	iff.expected \
-	iff.g4a \
-	while.expected \
-	while.g4a \
-	else.expected \
-	else.g4a \
-	break.expected \
-	break.g4a \
-	cont.expected \
-	cont.g4a \
-	halt.expected \
-	halt.g4a \
-	wait.expected \
-	wait.g4a \
-	endif.expected \
-	endif.g4a \
-	declare.expected \
-	declare.g4a \
-	immediate.g4a \
-	immediate.expected
-
-EXTRA_DIST = \
-	${TESTDATA} \
-	run-test.sh
-
-$(TESTS): run-test.sh
-	sed "s|TEST|$@|g" ${srcdir}/run-test.sh > $@
-	chmod +x $@
-
-CLEANFILES = \
-	*.out \
-	${TESTS}
diff --git a/assembler/test/run-test.sh b/assembler/test/run-test.sh
index 27c5c2d..20a408c 100644
--- a/assembler/test/run-test.sh
+++ b/assembler/test/run-test.sh
@@ -3,7 +3,7 @@
 SRCDIR=${srcdir-`pwd`}
 BUILDDIR=${top_builddir-`pwd`}
 
-${BUILDDIR}/assembler/intel-gen4asm -o TEST.out $SRCDIR/TEST.g4a
+${BUILDDIR}/intel-gen4asm -o TEST.out $SRCDIR/TEST.g4a
 if cmp TEST.out ${SRCDIR}/TEST.expected 2> /dev/null; then : ; else
   echo "Output comparison for TEST"
   diff -u ${SRCDIR}/TEST.expected TEST.out
-- 
2.8.0.rc3

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

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

* Re: [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built.
  2016-04-29 13:11 [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built Marius Vlad
  2016-04-29 13:11 ` [PATCH i-g-t 2/2] autotools, assembler: Fix check target for tests in assembler Marius Vlad
@ 2016-08-24  8:43 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2016-08-24  8:43 UTC (permalink / raw)
  To: Marius Vlad; +Cc: intel-gfx

On Fri, Apr 29, 2016 at 04:11:19PM +0300, Marius Vlad wrote:
> We need to have the test list generated before running the check target.
> Migrated igt_command_line.sh to tests/ from lib/tests/, which allows to
> building the tests and execute the script.
> 
> This would allow cleaning followed by a make check.
> 
> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>

I stumbled across this make check failure, and this looks like the fix.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-08-24  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29 13:11 [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built Marius Vlad
2016-04-29 13:11 ` [PATCH i-g-t 2/2] autotools, assembler: Fix check target for tests in assembler Marius Vlad
2016-08-24  8:43 ` [PATCH i-g-t 1/2] autotools: Check target requires to a have the list of tests built Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.