From 7ab5c97924bf971a348ff4a1768da624ba2f564c Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Fri, 10 Mar 2017 16:20:33 +0200 Subject: Always expose IGT subtests for known kernel selftests Even when the running kernel does not support selftests, make subtest enumeration list known kselftests. The list is generated using selftest listing headers copied from the kernel. If the running kernel gains new selftest subtests, they are listed even without copying the headers over and rebuilding IGT. v2: Use correct names for the testcases Signed-off-by: Petri Latvala --- tests/drm_mm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tests/drm_mm.c') diff --git a/tests/drm_mm.c b/tests/drm_mm.c index 2052b115..2a3212e8 100644 --- a/tests/drm_mm.c +++ b/tests/drm_mm.c @@ -28,5 +28,20 @@ IGT_TEST_DESCRIPTION("Basic sanity check of DRM's range manager (struct drm_mm)" igt_main { - igt_kselftests("test-drm_mm", NULL, NULL, NULL); + /* + * Set of subtest names that are always exposed by IGT, + * regardless of the running kernel's capabilities. Selftests + * that the kernel has but are not on these lists are also + * exposed. This is a known intentional violation of the + * general rule that subtest enumeration must not change + * depending on the runtime environment. + */ + struct igt_kselftest_mockentry drm_mm_testlist[] = { +#define selftest(n, x) { .name = #n, .do_mock = true }, +#include "drm_mm_selftests.h" +#undef selftest + { NULL, false } + }; + + igt_kselftests("test-drm_mm", NULL, NULL, NULL, drm_mm_testlist); } -- cgit v1.2.3