summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-07 11:16:54 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-12-07 11:17:55 +0000
commitae49296e067d1c9c5a5d9002de0a0d02911182b0 (patch)
tree75c93cb625a5b9e64b1ce4df06ee80c142683856
parent81677444e62d11bc690bb23ae580893bf2445483 (diff)
igt/drv_selftest: Adapt to mock/late split
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--lib/igt_kmod.c8
-rw-r--r--lib/igt_kmod.h4
-rw-r--r--tests/drm_mm.c2
-rw-r--r--tests/drv_selftest.c3
4 files changed, 13 insertions, 4 deletions
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index a861a5f2..388be30f 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -341,7 +341,9 @@ static void kmsg_dump(int fd)
}
}
-void igt_kselftests(const char *module_name, const char *module_options)
+void igt_kselftests(const char *module_name,
+ const char *module_options,
+ const char *filter)
{
const char *param_prefix = "igt__";
const int param_len = strlen(param_prefix);
@@ -378,6 +380,10 @@ void igt_kselftests(const char *module_name, const char *module_options)
if (!val || strncmp(val, param_prefix, param_len))
continue;
+ if (filter &&
+ strncmp(val + param_len, filter, strlen(filter)))
+ continue;
+
subtest = strdup(val);
colon = strchr(subtest, ':');
*colon = '\0';
diff --git a/lib/igt_kmod.h b/lib/igt_kmod.h
index 2822fe25..3eb6a345 100644
--- a/lib/igt_kmod.h
+++ b/lib/igt_kmod.h
@@ -35,6 +35,8 @@ int igt_kmod_unload(const char *mod_name, unsigned int flags);
int igt_i915_driver_load(const char *opts);
int igt_i915_driver_unload(void);
-void igt_kselftests(const char *module_name, const char *module_options);
+void igt_kselftests(const char *module_name,
+ const char *module_options,
+ const char *filter);
#endif /* IGT_KMOD_H */
diff --git a/tests/drm_mm.c b/tests/drm_mm.c
index 52a0159f..9c49990c 100644
--- a/tests/drm_mm.c
+++ b/tests/drm_mm.c
@@ -28,5 +28,5 @@ IGT_TEST_DESCRIPTION("Basic sanity check of DRM's range manager (struct drm_mm)"
igt_main
{
- igt_kselftests("test-drm_mm", NULL);
+ igt_kselftests("test-drm_mm", NULL, NULL);
}
diff --git a/tests/drv_selftest.c b/tests/drv_selftest.c
index 71c4c3d3..1968f698 100644
--- a/tests/drv_selftest.c
+++ b/tests/drv_selftest.c
@@ -28,5 +28,6 @@ IGT_TEST_DESCRIPTION("Basic unit tests for i915.ko");
igt_main
{
- igt_kselftests("i915", "selftest=-1");
+ igt_kselftests("i915", "mock_selftests=-1", "mock");
+ igt_kselftests("i915", "late_selftests=-1", "late");
}