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

Adam Jackson ajax at redhat.com
Wed Apr 25 19:58:07 UTC 2018


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>
---
 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



More information about the xorg-devel mailing list