[igt-dev] [PATCH i-g-t] tests/kms_setmode: Fix dynamic subtests

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Jun 21 16:43:08 UTC 2023


Hi Jeevan,

On 2023-06-20 at 23:55:08 +0530, Jeevan B wrote:
> basic-clone-single-crtc and invalid-clone-exclusive-crtc were not
> part of dynamic subtest so tests were getting skipped. fixed the
> test to execute skipping tests as expected.
> 
> Signed-off-by: Jeevan B <jeevan.b at intel.com>
> ---
>  tests/kms_setmode.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
> index a611d938..b1883b10 100644
> --- a/tests/kms_setmode.c
> +++ b/tests/kms_setmode.c
> @@ -647,20 +647,19 @@ static void test_one_combination(const struct test_config *tconf,
>  	struct crtc_config crtcs[MAX_CRTCS];
>  	int crtc_count;
>  	bool config_valid;
> +	int i, pos = 0;
> +	char test_name[256];
>  
>  	setup_crtcs(tconf, cconfs, connector_count, crtcs,
>  		    &crtc_count, &config_valid);
>  
> -	if (config_valid == !(tconf->flags & TEST_INVALID)) {
> -		int i, pos = 0;
> -		char test_name[256];
> -
> -		for (i = 0; i < crtc_count; i++) {
> -			if (i > 0)
> -				pos += snprintf(&test_name[pos], ARRAY_SIZE(test_name) - pos, "-");
> -			pos += get_test_name_str(&crtcs[i], &test_name[pos], ARRAY_SIZE(test_name) - pos);
> -		}
> +	for (i = 0; i < crtc_count; i++) {
> +		if (i > 0)
> +			pos += snprintf(&test_name[pos], ARRAY_SIZE(test_name) - pos, "-");
> +		pos += get_test_name_str(&crtcs[i], &test_name[pos], ARRAY_SIZE(test_name) - pos);
> +	}
>  
> +	if (config_valid == !(tconf->flags & TEST_INVALID)) {
>  		for (i = 0; i < crtc_count; i++) {
>  			struct crtc_config *crtc = &crtcs[i];
>  
> @@ -685,7 +684,8 @@ static void test_one_combination(const struct test_config *tconf,
>  
>  		igt_dynamic_f("%s", test_name)
----------------------------------- ^
This declares test name.

>  			test_crtc_config(tconf, crtcs, crtc_count);
----------------------- ^
And this executes it.

> -	}
> +	} else
> +		igt_dynamic_f("%s", test_name)

Call to test is missing here.

Regards,
Kamil

>  
>  out:
>  	cleanup_crtcs(crtcs, crtc_count);
> -- 
> 2.36.0
> 


More information about the igt-dev mailing list