[PATCH xts] Add 'q' command line option to count subtests

Peter Hutterer peter.hutterer at who-t.net
Thu Apr 26 23:28:40 UTC 2018


On Wed, Apr 25, 2018 at 03:58:07PM -0400, Adam Jackson wrote:
> At the moment piglit needs a copy of the test _source_ around, because
> it parses the .m files looking for >>ASSERTION to know how many subtests
> each executable contains. With this patch we can instead do:
> 
> datura:~/git/xts% xts5/Xlib4/*/XChangeWindowAttributes q
> 46
> 
> Sorry for the ad-hoc extern, but there's not a header for that
> declaration already. The code seems to also have a memory of a "reduced
> space" build where all the tests are linked into one giant binary; we
> don't support building that anyway, but this change would assuredly
> break it too.
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
but: any specific reason you don't just name it --count? it's just a strcmp
and would make things clearer

Cheers,
   Peter

> ---
>  src/tet3/tcm/dtcm.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/tet3/tcm/dtcm.c b/src/tet3/tcm/dtcm.c
> index 3d56e8d8..afb8c4eb 100644
> --- a/src/tet3/tcm/dtcm.c
> +++ b/src/tet3/tcm/dtcm.c
> @@ -295,6 +295,12 @@ char	**argv;
>  	if (!tcname)
>  		tcname = tet_pname;
>  
> +        if (argc > 1 && !strcmp(argv[1], "q")) {
> +            extern int ntests;
> +            printf("%d\n", ntests);
> +            exit(0);
> +        }
> +
>  #ifdef TET_LITE
>  	/* open execution results file (do early, so tet_error() can use it) */
>  	tet_openres(argv[0]);
> -- 
> 2.17.0
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list