[igt-dev] [PATCH i-g-t 03/10] lib/tests: Test that igt_describe works with dynamic subtests

Arkadiusz Hiler arkadiusz.hiler at intel.com
Wed Aug 28 12:33:09 UTC 2019


On Fri, Aug 16, 2019 at 12:34:19PM +0300, Petri Latvala wrote:
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> ---
>  lib/tests/igt_describe.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/tests/igt_describe.c b/lib/tests/igt_describe.c
> index 2ea47e9d..70ec055e 100644
> --- a/lib/tests/igt_describe.c
> +++ b/lib/tests/igt_describe.c
> @@ -87,6 +87,13 @@ static void fake_main(int argc, char **argv) {
>  	igt_subtest("F")
>  		;
>  
> +	igt_describe("Dynamic container");
> +	igt_dynamic_subtest_container("G") {
> +		printf("should not be executed!\n");

> +		igt_dynamic_subtest("should-not-list")

Have you tested this for:
	igt_describe("Dynamic subtest");
        igt_dynamic_subtest("should-not-list") {}


I think this has potential to mess up few things and should be
disallowed with a loud error message.

> +			printf("should not be executed!\n");
> +	}
> +
>  	igt_exit();
>  }
>  
> @@ -129,7 +136,10 @@ static const char DESCRIBE_ALL_OUTPUT[] = \
>  	"\n"
>  	"SUB F ../lib/tests/igt_describe.c:87:\n"
>  	"  verylongwordthatshoudlbeprintedeventhoughitspastthewrppinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n"
> -	"  verylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n\n";
> +	"  verylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n"
> +	"\n"
> +	"SUB G ../lib/tests/igt_describe.c:91:\n"
> +	"  Dynamic container\n\n";
>  
>  static const char JUST_C_OUTPUT[] = \
>  	"the top level description\n"
> -- 
> 2.19.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list