From 6e716b7f5768bb0218d2b5934472ed462560f13b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 13 Dec 2016 13:41:21 +0000 Subject: lib/kselftest: Apply the filter to the test name The filter needs to skip the embedded test number as well. Signed-off-by: Chris Wilson --- lib/igt_kmod.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/igt_kmod.c') diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c index b2d8913a..109fa81f 100644 --- a/lib/igt_kmod.c +++ b/lib/igt_kmod.c @@ -399,10 +399,6 @@ void igt_kselftests(const char *module_name, if (!val || strncmp(val, param_prefix, prefix_len)) continue; - if (filter && - strncmp(val + prefix_len, filter, strlen(filter))) - continue; - offset = strlen(val) + 1; tl = malloc(sizeof(*tl) + offset); if (!tl) @@ -418,6 +414,12 @@ void igt_kselftests(const char *module_name, &tl->number, &offset) == 1) tl->name += offset; + if (filter && + strncmp(tl->name, filter, strlen(filter))) { + free(tl); + continue; + } + tests_add(tl, &tests); } kmod_module_info_free_list(pre); -- cgit v1.2.3