[igt-dev] [PATCH i-g-t] tests/kms_dp_aux_dev: Convert test to dynamic

Modem, Bhanuprakash bhanuprakash.modem at intel.com
Thu Sep 29 10:21:03 UTC 2022


On Mon-19-09-2022 03:56 pm, Ananya Sharma wrote:
> Modified kms_dp_aux_dev to include dynamic test cases.
> 
> Signed-off-by: Ananya Sharma <ananya.sharma at intel.com>
> ---
>   tests/kms_dp_aux_dev.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/kms_dp_aux_dev.c b/tests/kms_dp_aux_dev.c
> index d3249fa3..ac12b500 100644
> --- a/tests/kms_dp_aux_dev.c
> +++ b/tests/kms_dp_aux_dev.c
> @@ -118,7 +118,7 @@ static bool test(int drm_fd, uint32_t connector_id)
>   	return false;
>   }
>   
> -igt_simple_main
> +igt_main
>   {
>   	int valid_connectors = 0;
>   	drmModeRes *res;
> @@ -129,8 +129,13 @@ igt_simple_main
>   	res = drmModeGetResources(drm_fd);
>   	igt_require(res);

Move this drm resources part to igt_fixture

>   
> -	for (int i = 0; i < res->count_connectors; i++)
> -		valid_connectors += test(drm_fd, res->connectors[i]);
> +	igt_subtest_with_dynamic("basic") {
> +		for (int i = 0; i < res->count_connectors; i++)
> +			igt_dynamic_f("subtest-%d", i) {

Please use the connector name for dynamic subtest.

Example:
igt_dynamic_f("%s-%d",
	kmstest_connector_type_str(connector->connector_type),
	connector->connector_type_id)

> +				valid_connectors += test(drm_fd, res->connectors[i]);
> +			}
> +	}
> +
>   	igt_require(valid_connectors);

This check is not required in case of dynamic subtests, IGT will throw 
the SKIP if igt_dynamic() is not executed at least once.

>   
>   	drmModeFreeResources(res);

Move this part to igt_fixture.

- Bhanu



More information about the igt-dev mailing list