@@ -77,6 +77,7 @@ static void help(void) {
77
77
printf ("Run the test suite for the project with optional configuration.\n\n" );
78
78
printf ("Options:\n" );
79
79
printf (" -help, -h Show this help message\n" );
80
+ printf (" -print_tests Display list of all available tests and modules\n" );
80
81
printf (" -j=<num>, -jobs=<num> Number of parallel worker processes (default: 0 = sequential)\n" );
81
82
printf (" -iter=<num>, -iterations=<num> Number of iterations for each test (default: 16)\n" );
82
83
printf (" -seed=<hex> Set a specific RNG seed (default: random)\n" );
@@ -90,6 +91,24 @@ static void help(void) {
90
91
printf (" - The first two positional arguments (iterations and seed) are also supported for backward compatibility.\n" );
91
92
}
92
93
94
+ /* Print all tests in registry */
95
+ static void print_test_list (struct TestFramework * tf ) {
96
+ int m , t , total = 0 ;
97
+ printf ("\nAvailable tests (%d modules):\n" , tf -> num_modules );
98
+ printf ("========================================\n" );
99
+ for (m = 0 ; m < tf -> num_modules ; m ++ ) {
100
+ struct TestModule * mod = & tf -> registry_modules [m ];
101
+ printf ("Module: %s (%d tests)\n" , mod -> name , mod -> size );
102
+ for (t = 0 ; t < mod -> size ; t ++ ) {
103
+ printf ("\t[%3d] %s\n" , total + 1 , mod -> data [t ].name );
104
+ total ++ ;
105
+ }
106
+ printf ("----------------------------------------\n" );
107
+ }
108
+ printf ("\nRun specific module: ./tests -t=<module_name>\n" );
109
+ printf ("Run specific test: ./tests -t=<test_name>\n\n" );
110
+ }
111
+
93
112
static int parse_jobs_count (const char * key , const char * value , struct Args * out ) {
94
113
char * ptr_val ;
95
114
long val = strtol (value , & ptr_val , 10 ); /* base 10 */
@@ -287,6 +306,12 @@ static int tf_init(struct TestFramework* tf, int argc, char** argv)
287
306
exit (EXIT_SUCCESS );
288
307
}
289
308
309
+ /* Check if we need to print the available tests */
310
+ if (argv [1 ] && strcmp (argv [1 ], "-print_tests" ) == 0 ) {
311
+ print_test_list (tf );
312
+ exit (EXIT_SUCCESS );
313
+ }
314
+
290
315
/* Compatibility Note: The first two args were the number of iterations and the seed. */
291
316
/* If provided, parse them and adjust the starting index for named arguments accordingly. */
292
317
if (argv [1 ] && argv [1 ][0 ] != '-' ) {
0 commit comments