[igt-dev] [PATCH i-g-t] kms_flip_event_leak: Create dynamic subtests

Modem, Bhanuprakash bhanuprakash.modem at intel.com
Wed Sep 14 02:50:49 UTC 2022


On Fri-09-09-2022 12:44 pm, Jeevan B wrote:
> Converting the existing subtests to dynamic subtests.
> 
> Signed-off-by: Jeevan B <jeevan.b at intel.com>
> ---
>   tests/kms_flip_event_leak.c | 27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/kms_flip_event_leak.c b/tests/kms_flip_event_leak.c
> index ac201293..33aa6ab3 100644
> --- a/tests/kms_flip_event_leak.c
> +++ b/tests/kms_flip_event_leak.c
> @@ -89,24 +89,33 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output)
>   	igt_remove_fb(data->drm_fd, &fb[0]);
>   }
>   
> -igt_simple_main
> +igt_main
>   {
>   	data_t data = {};
>   	igt_output_t *output;
>   	int valid_tests = 0;
>   	enum pipe pipe;
>   
> -	data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> -	kmstest_set_vt_graphics_mode();
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +		kmstest_set_vt_graphics_mode();
> +
> +		igt_display_require(&data.display, data.drm_fd);

Please add igt_disply_require_output() in igt_fixture.

> +	}
>   
> -	igt_display_require(&data.display, data.drm_fd);
>   
> -	for_each_pipe_with_valid_output(&data.display, pipe, output) {
> -		test(&data, pipe, output);
> -		valid_tests++;
> +	igt_subtest_with_dynamic("kms_flip_event_leak") {

Binary name as subtest name? Please update it "basic" or something useful.

> +		for_each_pipe_with_valid_output(&data.display, pipe, output) {
> +			igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {

Please append output name to dynamic subtest.
Ex: pipe-A-DP-1

> +				test(&data, pipe, output);

Please add igt_display_reset() just before calling test() or inside the 
test() just before calling igt_output_set_pipe()

> +				valid_tests++;
> +			}
> +		}
>   	}
>   
> -	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> +	igt_fixture {
> +		igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");

This check is not required, igt will throw SKIP if igt_dynamic*() is not 
executed.

- Bhanu

>   
> -	igt_display_fini(&data.display);
> +		igt_display_fini(&data.display);
> +	}
>   }



More information about the igt-dev mailing list