summaryrefslogtreecommitdiff
path: root/tests/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-01-22 18:31:49 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-01-30 09:51:09 +0000
commit4177d0d6a40fe96e3d859be0413bf66ef9a8a606 (patch)
treef45beb5029466778369199a966930c7a3630e02e /tests/i915
parent07e227a53baf29b8be1a31cea1f7cf72af18643c (diff)
i915/selftest: Allow filtering of individual subtests
Take an environment variable, SELFTESTS=foo,bar, and pass that along to the kernel (as i915.st_filter=foo,bar) to provide fine grained test selection. This can be either as an exact match to select only that test, or to exclude only test. For example, SELFTESTS=igt_vma_create,igt_vma_pin1 i915_selftest --run mock_vma SELFTESTS=!igt_vma_create i915_selftest --run mock_vma v2: Replace NULL with the empty string. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r--tests/i915/selftest.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/i915/selftest.c b/tests/i915/selftest.c
index 80e515c6..6d597e68 100644
--- a/tests/i915/selftest.c
+++ b/tests/i915/selftest.c
@@ -28,10 +28,16 @@ IGT_TEST_DESCRIPTION("Basic unit tests for i915.ko");
igt_main
{
- igt_kselftests("i915",
- "mock_selftests=-1 disable_display=1",
- NULL, "mock");
- igt_kselftests("i915",
- "live_selftests=-1 disable_display=1",
- "live_selftests", "live");
+ const char *env = getenv("SELFTESTS") ?: "";
+ char opts[1024];
+
+ igt_assert(snprintf(opts, sizeof(opts),
+ "mock_selftests=-1 disable_display=1 st_filter=%s",
+ env) < sizeof(opts));
+ igt_kselftests("i915", opts, NULL, "mock");
+
+ igt_assert(snprintf(opts, sizeof(opts),
+ "live_selftests=-1 disable_display=1 st_filter=%s",
+ env) < sizeof(opts));
+ igt_kselftests("i915", opts, "live_selftests", "live");
}