All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] igt subtests support and piglit integration
@ 2012-11-27 20:13 Daniel Vetter
  2012-11-27 20:13 ` [PATCH 1/5] tests: infrastructure for piglit runner Daniel Vetter
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Daniel Vetter @ 2012-11-27 20:13 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Hi all,

This little patchseries adds some support to the Makefiles so that the piglit
igt integration can automagically enumerate tests, without the need to specify
things at a hundred different places.

The second part adds some small infrastructure to support subtests in a simple
way. The piglit support adds each subtests as a sparate testcase, and starts
each binary with --run-subtest <testname> for each one. As a proof of concept
I've converted flip_test, but I plan to slouch through all the others in the
next few days.

I've pushed the piglit stuff to

http://cgit.freedesktop.org/~danvet/piglit/log/

Comments and flames highly welcome.

Cheers, Daniel

Daniel Vetter (5):
  tests: infrastructure for piglit runner
  tests: remove ZZ_check_dmesg from runner
  tests: dont polute stderr if the test succeeds/skips
  lib/drmtest: subtest infrastructure
  tests/flip_test: use subtest infrastructure

 lib/drmtest.c           | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
 lib/drmtest.h           |  3 +++
 tests/Makefile.am       | 44 +++++++++++++++++++++++++++-------
 tests/flip_test.c       | 51 +++++++++++++++++++++------------------
 tests/gem_cpu_reloc.c   |  2 +-
 tests/gem_cs_prefetch.c |  2 +-
 tests/gem_ctx_create.c  |  2 +-
 tests/sysfs_rps.c       |  2 +-
 8 files changed, 133 insertions(+), 36 deletions(-)

-- 
1.7.11.7

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

* [PATCH 1/5] tests: infrastructure for piglit runner
  2012-11-27 20:13 [PATCH 0/5] igt subtests support and piglit integration Daniel Vetter
@ 2012-11-27 20:13 ` Daniel Vetter
  2012-11-27 20:13 ` [PATCH 2/5] tests: remove ZZ_check_dmesg from runner Daniel Vetter
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2012-11-27 20:13 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Piglit needs a way to grab the latest list of tests to run, so add new
make targets to dump those. Note that for future extendability we'll
dump 2 different lists, one for single-testcase tests and one for
testcases with enumerable subcases. Some support code for the later
will follow in subsequent patches.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/Makefile.am | 41 ++++++++++++++++++++++++++++++++++-------
 1 file changed, 34 insertions(+), 7 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 735eb09..f7b530f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,7 @@
 noinst_PROGRAMS = \
 	gem_stress \
 	$(TESTS_progs) \
+	$(TESTS_progs_M) \
 	$(HANG) \
 	$(NULL)
 
@@ -11,6 +12,9 @@ NOUVEAU_TESTS = \
 	prime_nv_test
 endif
 
+TESTS_progs_M = \
+	$(NULL)
+
 TESTS_progs = \
 	getversion \
 	getclient \
@@ -30,7 +34,7 @@ TESTS_progs = \
 	gem_ringfill \
 	gem_mmap \
 	gem_mmap_gtt \
-	gem_mmap_offset_exhaustion \
+	#gem_mmap_offset_exhaustion \
 	gem_non_secure_batch \
 	gem_pwrite \
 	gem_pread_after_blit \
@@ -91,6 +95,9 @@ TESTS_progs = \
 
 # IMPORTANT: The ZZ_ tests need to be run last!
 # ... and make can't deal with inlined comments ...
+TESTS_scripts_M = \
+	$(NULL)
+
 TESTS_scripts = \
 	debugfs_reader \
 	debugfs_emon_crash \
@@ -101,18 +108,38 @@ TESTS_scripts = \
 	ZZ_hangman \
 	$(NULL)
 
-kernel_tests = \
+multi_kernel_tests = \
+	$(TESTS_progs_M) \
+	$(TESTS_scripts_M) \
+	$(NULL)
+
+single_kernel_tests = \
 	$(TESTS_progs) \
 	$(TESTS_scripts) \
 	$(NULL)
 
+kernel_tests = \
+	$(single_kernel_tests) \
+	$(multi_kernel_tests) \
+	$(NULL)
+
 TESTS = \
 	$(NULL)
 
 test:
-	whoami | grep root || ( echo ERROR: not running as root; exit 1 )
-	./check_drm_clients
-	make TESTS="${kernel_tests}" check
+	@whoami | grep root || ( echo ERROR: not running as root; exit 1 )
+	@./check_drm_clients
+	@make TESTS="${kernel_tests}" check
+
+list-single-tests:
+	@echo TESTLIST
+	@echo ${single_kernel_tests}
+	@echo END TESTLIST
+
+list-multi-tests:
+	@echo TESTLIST
+	@echo ${multi_kernel_tests}
+	@echo END TESTLIST
 
 HANG = \
 	gem_bad_batch \
@@ -121,8 +148,8 @@ HANG = \
 	gem_bad_address \
 	$(NULL)
 
-EXTRA_PROGRAMS = $(TESTS_progs) $(HANG)
-EXTRA_DIST = $(TESTS_scripts) drm_lib.sh check_drm_clients debugfs_wedged
+EXTRA_PROGRAMS = $(TESTS_progs) $(TESTS_progs_M) $(HANG)
+EXTRA_DIST = $(TESTS_scripts) $(TESTS_scripts_M) drm_lib.sh check_drm_clients debugfs_wedged
 CLEANFILES = $(EXTRA_PROGRAMS)
 
 AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \
-- 
1.7.11.7

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

* [PATCH 2/5] tests: remove ZZ_check_dmesg from runner
  2012-11-27 20:13 [PATCH 0/5] igt subtests support and piglit integration Daniel Vetter
  2012-11-27 20:13 ` [PATCH 1/5] tests: infrastructure for piglit runner Daniel Vetter
@ 2012-11-27 20:13 ` Daniel Vetter
  2012-11-27 20:13 ` [PATCH 3/5] tests: dont polute stderr if the test succeeds/skips Daniel Vetter
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2012-11-27 20:13 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

This is getting in the way of piglit integration. If we want this
functionality again, we should integrate it into the IGT piglit runner
as an option.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/Makefile.am | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index f7b530f..ff6e829 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -104,7 +104,6 @@ TESTS_scripts = \
 	sysfs_l3_parity \
 	sysfs_edid_timing \
 	module_reload \
-	ZZ_check_dmesg \
 	ZZ_hangman \
 	$(NULL)
 
-- 
1.7.11.7

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

* [PATCH 3/5] tests: dont polute stderr if the test succeeds/skips
  2012-11-27 20:13 [PATCH 0/5] igt subtests support and piglit integration Daniel Vetter
  2012-11-27 20:13 ` [PATCH 1/5] tests: infrastructure for piglit runner Daniel Vetter
  2012-11-27 20:13 ` [PATCH 2/5] tests: remove ZZ_check_dmesg from runner Daniel Vetter
@ 2012-11-27 20:13 ` Daniel Vetter
  2012-11-27 20:13 ` [PATCH 4/5] lib/drmtest: subtest infrastructure Daniel Vetter
  2012-11-27 20:13 ` [PATCH 5/5] tests/flip_test: use " Daniel Vetter
  4 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2012-11-27 20:13 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Results in spurious 'warn' results in piglit. Also don't print
progress indicators when not outputting to a terminal.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/drmtest.c           | 3 +++
 tests/gem_cpu_reloc.c   | 2 +-
 tests/gem_cs_prefetch.c | 2 +-
 tests/gem_ctx_create.c  | 2 +-
 tests/sysfs_rps.c       | 2 +-
 5 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index c309851..a18b3a0 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -543,6 +543,9 @@ void drmtest_progress(const char *header, uint64_t i, uint64_t total)
 {
 	int divider = 200;
 
+	if (!isatty(fileno(stderr)))
+		return;
+
 	if (i+1 >= total) {
 		fprintf(stderr, "\r%s100%%\n", header);
 		return;
diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c
index 787e507..baf8301 100644
--- a/tests/gem_cpu_reloc.c
+++ b/tests/gem_cpu_reloc.c
@@ -209,7 +209,7 @@ int main(int argc, char **argv)
 		drmtest_progress("gem_cpu_reloc: ", 2*count+i, 3*count);
 	}
 
-	fprintf(stderr, "Test suceeded, cleanup up - this might take a while.\n");
+	printf("Test suceeded, cleanup up - this might take a while.\n");
 	close(fd);
 
 	return 0;
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index 9ba8028..9ef35eb 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -163,7 +163,7 @@ int main(int argc, char **argv)
 		drmtest_progress("gem_cs_prefetch: ", i, count);
 	}
 
-	fprintf(stderr, "Test suceeded, cleanup up - this might take a while.\n");
+	printf("Test suceeded, cleanup up - this might take a while.\n");
 	drm_intel_bufmgr_destroy(bufmgr);
 
 	close(fd);
diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c
index def76d3..84ef214 100644
--- a/tests/gem_ctx_create.c
+++ b/tests/gem_ctx_create.c
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
 
 	ret = drmIoctl(fd, CONTEXT_CREATE_IOCTL, &create);
 	if (ret != 0 && (errno == ENODEV || errno == EINVAL)) {
-		fprintf(stderr, "Kernel is too old, or contexts not supported: %s\n",
+		printf("Kernel is too old, or contexts not supported: %s\n",
 			strerror(errno));
 		exit(77);
 	} else if (ret != 0) {
diff --git a/tests/sysfs_rps.c b/tests/sysfs_rps.c
index 94c4382..8ba541c 100644
--- a/tests/sysfs_rps.c
+++ b/tests/sysfs_rps.c
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
 		assert(ret != -1);
 		junk->filp = fopen(path, junk->mode);
 		if (junk->filp == NULL) {
-			fprintf(stderr, "Kernel is too old. GTFO\n");
+			printf("Kernel is too old. GTFO\n");
 			exit(77);
 		}
 		val = readval(junk->filp);
-- 
1.7.11.7

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

* [PATCH 4/5] lib/drmtest: subtest infrastructure
  2012-11-27 20:13 [PATCH 0/5] igt subtests support and piglit integration Daniel Vetter
                   ` (2 preceding siblings ...)
  2012-11-27 20:13 ` [PATCH 3/5] tests: dont polute stderr if the test succeeds/skips Daniel Vetter
@ 2012-11-27 20:13 ` Daniel Vetter
  2012-11-27 20:13 ` [PATCH 5/5] tests/flip_test: use " Daniel Vetter
  4 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2012-11-27 20:13 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

To make these helpers as least invasive as possible simply initialize
the options with a getopt parser and let the control flow be steered
with a simple helper which gets the subtest name as an argument.

The only tricky part for using it is that the subtest check helper
doubles up as the conduit to enumerate tests (and in that mode
prevents any test from being run). It is therefore important that
nothing gets printed to stdout outside of these checks.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/drmtest.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/drmtest.h |  3 +++
 2 files changed, 63 insertions(+)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index a18b3a0..8ff4b2e 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -36,6 +36,7 @@
 #include <signal.h>
 #include <pciaccess.h>
 #include <math.h>
+#include <getopt.h>
 
 #include "drmtest.h"
 #include "i915_drm.h"
@@ -513,6 +514,65 @@ void drmtest_stop_signal_helper(void)
 	signal_helper = -1;
 }
 
+/* subtests helpers */
+static bool list_subtests = false;
+static char *run_single_subtest = NULL;
+
+void drmtest_subtest_init(int argc, char **argv)
+{
+	int c, option_index = 0;
+	static struct option long_options[] = {
+		{"list-subtests", 0, 0, 'l'},
+		{"run-subtest", 1, 0, 'r'},
+		{NULL, 0, 0, 0,}
+	};
+
+	/* supress getopt errors about unknown options */
+	opterr = 0;
+	while((c = getopt_long(argc, argv, "",
+			       long_options, &option_index)) != -1) {
+		switch(c) {
+		case 'l':
+			list_subtests = true;
+			goto out;
+		case 'S':
+			run_single_subtest = strdup(optarg);
+			goto out;
+		}
+	}
+
+out:
+	/* reset opt parsing */
+	optind = 1;
+}
+
+/*
+ * Note: Testcases which use these helpers MUST NOT output anything to stdout
+ * outside of places protected by drmtest_run_subtest checks - the piglit
+ * runner adds every line to the subtest list.
+ */
+bool drmtest_run_subtest(const char *subtest_name)
+{
+	if (list_subtests) {
+		printf("%s\n", subtest_name);
+		return false;
+	}
+
+	if (!run_single_subtest) {
+		return true;
+	} else {
+		if (strcmp(subtest_name, run_single_subtest) == 0)
+			return true;
+
+		return false;
+	}
+}
+
+bool drmtest_only_list_subtests(void)
+{
+	return list_subtests;
+}
+
 /* other helpers */
 void drmtest_exchange_int(void *array, unsigned i, unsigned j)
 {
diff --git a/lib/drmtest.h b/lib/drmtest.h
index fcb10bb..796fa83 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -84,6 +84,9 @@ void drmtest_permute_array(void *array, unsigned size,
 						 unsigned i,
 						 unsigned j));
 void drmtest_progress(const char *header, uint64_t i, uint64_t total);
+void drmtest_subtest_init(int argc, char **argv);
+bool drmtest_run_subtest(const char *subtest_name);
+bool drmtest_only_list_subtests(void);
 
 /* helpers based upon the libdrm buffer manager */
 void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr);
-- 
1.7.11.7

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

* [PATCH 5/5] tests/flip_test: use subtest infrastructure
  2012-11-27 20:13 [PATCH 0/5] igt subtests support and piglit integration Daniel Vetter
                   ` (3 preceding siblings ...)
  2012-11-27 20:13 ` [PATCH 4/5] lib/drmtest: subtest infrastructure Daniel Vetter
@ 2012-11-27 20:13 ` Daniel Vetter
  2012-11-29 11:30   ` Jani Nikula
  4 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2012-11-27 20:13 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

To make the testnames easier to handle in scripts, replace all
spaces with dashes.

The important part is to not print anything to stdout when enumerating
subtests, so protect the timestamp test with the right check.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/Makefile.am |  2 +-
 tests/flip_test.c | 51 ++++++++++++++++++++++++++++-----------------------
 2 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index ff6e829..f4a3abb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,6 +13,7 @@ NOUVEAU_TESTS = \
 endif
 
 TESTS_progs_M = \
+	flip_test \
 	$(NULL)
 
 TESTS_progs = \
@@ -81,7 +82,6 @@ TESTS_progs = \
 	drm_vma_limiter_cached \
 	sysfs_rc6_residency \
 	sysfs_rps \
-	flip_test \
 	gem_wait_render_timeout \
 	gem_ctx_create \
 	gem_ctx_bad_destroy \
diff --git a/tests/flip_test.c b/tests/flip_test.c
index 5214da9..5ad62d1 100644
--- a/tests/flip_test.c
+++ b/tests/flip_test.c
@@ -969,50 +969,55 @@ int main(int argc, char **argv)
 		int flags;
 		const char *name;
 	} tests[] = {
-		{ 15, TEST_VBLANK | TEST_CHECK_TS, "wf-vblank" },
+		{ 15, TEST_VBLANK | TEST_CHECK_TS, "wf_vblank" },
 		{ 15, TEST_VBLANK | TEST_VBLANK_BLOCK | TEST_CHECK_TS,
-					"blocking wf-vblank" },
+					"blocking-wf_vblank" },
 		{ 5,  TEST_VBLANK | TEST_VBLANK_ABSOLUTE,
-					"absolute wf-vblank" },
+					"absolute-wf_vblank" },
 		{ 5,  TEST_VBLANK | TEST_VBLANK_BLOCK | TEST_VBLANK_ABSOLUTE,
-					"blocking absolute wf-vblank" },
-		{ 30,  TEST_VBLANK | TEST_DPMS | TEST_EINVAL, "wf-vblank vs dpms" },
+					"blocking-absolute-wf_vblank" },
+		{ 30,  TEST_VBLANK | TEST_DPMS | TEST_EINVAL, "wf_vblank-vs-dpms" },
 		{ 30,  TEST_VBLANK | TEST_DPMS | TEST_WITH_DUMMY_LOAD,
-					"delayed wf-vblank vs dpms" },
-		{ 30,  TEST_VBLANK | TEST_MODESET | TEST_EINVAL, "wf-vblank vs modeset" },
+					"delayed-wf_vblank-vs-dpms" },
+		{ 30,  TEST_VBLANK | TEST_MODESET | TEST_EINVAL, "wf_vblank-vs-modeset" },
 		{ 30,  TEST_VBLANK | TEST_MODESET | TEST_WITH_DUMMY_LOAD,
-					"delayed wf-vblank vs modeset" },
-
-		{ 15, TEST_FLIP | TEST_CHECK_TS | TEST_EBUSY , "plain flip" },
-		{ 30, TEST_FLIP | TEST_DPMS | TEST_EINVAL, "flip vs dpms" },
-		{ 30, TEST_FLIP | TEST_DPMS | TEST_WITH_DUMMY_LOAD, "delayed flip vs dpms" },
-		{ 5,  TEST_FLIP | TEST_PAN, "flip vs panning" },
-		{ 30, TEST_FLIP | TEST_PAN | TEST_WITH_DUMMY_LOAD, "delayed flip vs panning" },
-		{ 30, TEST_FLIP | TEST_MODESET | TEST_EINVAL, "flip vs modeset" },
-		{ 30, TEST_FLIP | TEST_MODESET | TEST_WITH_DUMMY_LOAD, "delayed flip vs modeset" },
+					"delayed-wf_vblank-vs-modeset" },
+
+		{ 15, TEST_FLIP | TEST_CHECK_TS | TEST_EBUSY , "plain-flip" },
+		{ 30, TEST_FLIP | TEST_DPMS | TEST_EINVAL, "flip-vs-dpms" },
+		{ 30, TEST_FLIP | TEST_DPMS | TEST_WITH_DUMMY_LOAD, "delayed-flip-vs-dpms" },
+		{ 5,  TEST_FLIP | TEST_PAN, "flip-vs-panning" },
+		{ 30, TEST_FLIP | TEST_PAN | TEST_WITH_DUMMY_LOAD, "delayed-flip-vs-panning" },
+		{ 30, TEST_FLIP | TEST_MODESET | TEST_EINVAL, "flip-vs-modeset" },
+		{ 30, TEST_FLIP | TEST_MODESET | TEST_WITH_DUMMY_LOAD, "delayed-flip-vs-modeset" },
 		{ 5,  TEST_FLIP | TEST_VBLANK_EXPIRED_SEQ,
-					"flip vs. expired vblank" },
+					"flip-vs-expired-vblank" },
 
 		{ 15, TEST_FLIP | TEST_VBLANK | TEST_VBLANK_ABSOLUTE |
-		      TEST_CHECK_TS, "flip vs absolute wf-vblank" },
+		      TEST_CHECK_TS, "flip-vs-absolute-wf_vblank" },
 		{ 15, TEST_FLIP | TEST_VBLANK | TEST_CHECK_TS,
-					"flip vs wf-vblank" },
+					"flip-vs-wf_vblank" },
 		{ 15, TEST_FLIP | TEST_VBLANK | TEST_VBLANK_BLOCK |
-			TEST_CHECK_TS, "flip vs blocking wf-vblank" },
+			TEST_CHECK_TS, "flip-vs-blocking-wf-vblank" },
 	};
 	int i;
 
+	drmtest_subtest_init(argc, argv);
+
 	drm_fd = drm_open_any();
 
-	get_timestamp_format();
+	if (!drmtest_only_list_subtests())
+		get_timestamp_format();
 
 	bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
 	devid = intel_get_drm_devid(drm_fd);
 	batch = intel_batchbuffer_alloc(bufmgr, devid);
 
 	for (i = 0; i < sizeof(tests) / sizeof (tests[0]); i++) {
-		printf("running testcase: %s\n", tests[i].name);
-		run_test(tests[i].duration, tests[i].flags, tests[i].name);
+		if (drmtest_run_subtest(tests[i].name)) {
+			printf("running testcase: %s\n", tests[i].name);
+			run_test(tests[i].duration, tests[i].flags, tests[i].name);
+		}
 	}
 
 	close(drm_fd);
-- 
1.7.11.7

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

* Re: [PATCH 5/5] tests/flip_test: use subtest infrastructure
  2012-11-27 20:13 ` [PATCH 5/5] tests/flip_test: use " Daniel Vetter
@ 2012-11-29 11:30   ` Jani Nikula
  0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2012-11-29 11:30 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Tue, 27 Nov 2012, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> To make the testnames easier to handle in scripts, replace all
> spaces with dashes.
>
> The important part is to not print anything to stdout when enumerating
> subtests, so protect the timestamp test with the right check.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  tests/Makefile.am |  2 +-
>  tests/flip_test.c | 51 ++++++++++++++++++++++++++++-----------------------
>  2 files changed, 29 insertions(+), 24 deletions(-)
>
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index ff6e829..f4a3abb 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -13,6 +13,7 @@ NOUVEAU_TESTS = \
>  endif
>  
>  TESTS_progs_M = \
> +	flip_test \
>  	$(NULL)
>  
>  TESTS_progs = \
> @@ -81,7 +82,6 @@ TESTS_progs = \
>  	drm_vma_limiter_cached \
>  	sysfs_rc6_residency \
>  	sysfs_rps \
> -	flip_test \
>  	gem_wait_render_timeout \
>  	gem_ctx_create \
>  	gem_ctx_bad_destroy \
> diff --git a/tests/flip_test.c b/tests/flip_test.c
> index 5214da9..5ad62d1 100644
> --- a/tests/flip_test.c
> +++ b/tests/flip_test.c
> @@ -969,50 +969,55 @@ int main(int argc, char **argv)
>  		int flags;
>  		const char *name;
>  	} tests[] = {
> -		{ 15, TEST_VBLANK | TEST_CHECK_TS, "wf-vblank" },
> +		{ 15, TEST_VBLANK | TEST_CHECK_TS, "wf_vblank" },
>  		{ 15, TEST_VBLANK | TEST_VBLANK_BLOCK | TEST_CHECK_TS,
> -					"blocking wf-vblank" },
> +					"blocking-wf_vblank" },

The commit message says nothing about replacing dashes with
underscores. Seems to me it would be better to leave dashes as they are,
and replace spaces with underscores. Or replace all [^a-zA-Z0-9] with -.

BR,
Jani.

>  		{ 5,  TEST_VBLANK | TEST_VBLANK_ABSOLUTE,
> -					"absolute wf-vblank" },
> +					"absolute-wf_vblank" },
>  		{ 5,  TEST_VBLANK | TEST_VBLANK_BLOCK | TEST_VBLANK_ABSOLUTE,
> -					"blocking absolute wf-vblank" },
> -		{ 30,  TEST_VBLANK | TEST_DPMS | TEST_EINVAL, "wf-vblank vs dpms" },
> +					"blocking-absolute-wf_vblank" },
> +		{ 30,  TEST_VBLANK | TEST_DPMS | TEST_EINVAL, "wf_vblank-vs-dpms" },
>  		{ 30,  TEST_VBLANK | TEST_DPMS | TEST_WITH_DUMMY_LOAD,
> -					"delayed wf-vblank vs dpms" },
> -		{ 30,  TEST_VBLANK | TEST_MODESET | TEST_EINVAL, "wf-vblank vs modeset" },
> +					"delayed-wf_vblank-vs-dpms" },
> +		{ 30,  TEST_VBLANK | TEST_MODESET | TEST_EINVAL, "wf_vblank-vs-modeset" },
>  		{ 30,  TEST_VBLANK | TEST_MODESET | TEST_WITH_DUMMY_LOAD,
> -					"delayed wf-vblank vs modeset" },
> -
> -		{ 15, TEST_FLIP | TEST_CHECK_TS | TEST_EBUSY , "plain flip" },
> -		{ 30, TEST_FLIP | TEST_DPMS | TEST_EINVAL, "flip vs dpms" },
> -		{ 30, TEST_FLIP | TEST_DPMS | TEST_WITH_DUMMY_LOAD, "delayed flip vs dpms" },
> -		{ 5,  TEST_FLIP | TEST_PAN, "flip vs panning" },
> -		{ 30, TEST_FLIP | TEST_PAN | TEST_WITH_DUMMY_LOAD, "delayed flip vs panning" },
> -		{ 30, TEST_FLIP | TEST_MODESET | TEST_EINVAL, "flip vs modeset" },
> -		{ 30, TEST_FLIP | TEST_MODESET | TEST_WITH_DUMMY_LOAD, "delayed flip vs modeset" },
> +					"delayed-wf_vblank-vs-modeset" },
> +
> +		{ 15, TEST_FLIP | TEST_CHECK_TS | TEST_EBUSY , "plain-flip" },
> +		{ 30, TEST_FLIP | TEST_DPMS | TEST_EINVAL, "flip-vs-dpms" },
> +		{ 30, TEST_FLIP | TEST_DPMS | TEST_WITH_DUMMY_LOAD, "delayed-flip-vs-dpms" },
> +		{ 5,  TEST_FLIP | TEST_PAN, "flip-vs-panning" },
> +		{ 30, TEST_FLIP | TEST_PAN | TEST_WITH_DUMMY_LOAD, "delayed-flip-vs-panning" },
> +		{ 30, TEST_FLIP | TEST_MODESET | TEST_EINVAL, "flip-vs-modeset" },
> +		{ 30, TEST_FLIP | TEST_MODESET | TEST_WITH_DUMMY_LOAD, "delayed-flip-vs-modeset" },
>  		{ 5,  TEST_FLIP | TEST_VBLANK_EXPIRED_SEQ,
> -					"flip vs. expired vblank" },
> +					"flip-vs-expired-vblank" },
>  
>  		{ 15, TEST_FLIP | TEST_VBLANK | TEST_VBLANK_ABSOLUTE |
> -		      TEST_CHECK_TS, "flip vs absolute wf-vblank" },
> +		      TEST_CHECK_TS, "flip-vs-absolute-wf_vblank" },
>  		{ 15, TEST_FLIP | TEST_VBLANK | TEST_CHECK_TS,
> -					"flip vs wf-vblank" },
> +					"flip-vs-wf_vblank" },
>  		{ 15, TEST_FLIP | TEST_VBLANK | TEST_VBLANK_BLOCK |
> -			TEST_CHECK_TS, "flip vs blocking wf-vblank" },
> +			TEST_CHECK_TS, "flip-vs-blocking-wf-vblank" },
>  	};
>  	int i;
>  
> +	drmtest_subtest_init(argc, argv);
> +
>  	drm_fd = drm_open_any();
>  
> -	get_timestamp_format();
> +	if (!drmtest_only_list_subtests())
> +		get_timestamp_format();
>  
>  	bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
>  	devid = intel_get_drm_devid(drm_fd);
>  	batch = intel_batchbuffer_alloc(bufmgr, devid);
>  
>  	for (i = 0; i < sizeof(tests) / sizeof (tests[0]); i++) {
> -		printf("running testcase: %s\n", tests[i].name);
> -		run_test(tests[i].duration, tests[i].flags, tests[i].name);
> +		if (drmtest_run_subtest(tests[i].name)) {
> +			printf("running testcase: %s\n", tests[i].name);
> +			run_test(tests[i].duration, tests[i].flags, tests[i].name);
> +		}
>  	}
>  
>  	close(drm_fd);
> -- 
> 1.7.11.7
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2012-11-29 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27 20:13 [PATCH 0/5] igt subtests support and piglit integration Daniel Vetter
2012-11-27 20:13 ` [PATCH 1/5] tests: infrastructure for piglit runner Daniel Vetter
2012-11-27 20:13 ` [PATCH 2/5] tests: remove ZZ_check_dmesg from runner Daniel Vetter
2012-11-27 20:13 ` [PATCH 3/5] tests: dont polute stderr if the test succeeds/skips Daniel Vetter
2012-11-27 20:13 ` [PATCH 4/5] lib/drmtest: subtest infrastructure Daniel Vetter
2012-11-27 20:13 ` [PATCH 5/5] tests/flip_test: use " Daniel Vetter
2012-11-29 11:30   ` Jani Nikula

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.