[PATCH i-g-t v2 1/6] lib/kunit: Skip on empty list of test cases

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Feb 1 14:30:31 UTC 2024


Hi Janusz,
On 2024-01-31 at 19:03:48 +0100, Janusz Krzysztofik wrote:
> If loading the base KUnit module in list mode succeeds but our KTAP
> parser or test suite filter returns an empty list of test cases then,
> instead of calling igt_skip, we now unintentionally fall back to legacy
> mode as if the module didn't support filter parameters.  Fix it.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  lib/igt_kmod.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 250ab2107b..ad69173151 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -1163,6 +1163,7 @@ static void kunit_get_tests(struct igt_list_head *tests,
>  
>  	igt_skip_on_f(err,
>  		      "KTAP parser failed while getting a list of test cases\n");
> +	igt_skip_on(igt_list_empty(tests));
>  }
>  
>  static void __igt_kunit(struct igt_ktest *tst,
> -- 
> 2.43.0
> 


More information about the igt-dev mailing list