@@ -92,6 +92,7 @@ static void help(void) {
92
92
printf ("Run the test suite for the project with optional configuration.\n\n" );
93
93
printf ("Options:\n" );
94
94
printf (" -help Show this help message\n" );
95
+ printf (" -print_tests Display list of available tests\n" );
95
96
printf (" -j=<num>, -jobs=<num> Number of parallel worker processes (default: 0 = sequential)\n" );
96
97
printf (" -iter=<num>, -iterations=<num> Number of iterations for each test (default: 64)\n" );
97
98
printf (" -seed=<hex> Set a specific RNG seed (default: random)\n" );
@@ -104,6 +105,17 @@ static void help(void) {
104
105
printf (" - The first two positional arguments (iterations and seed) are also supported for backward compatibility.\n" );
105
106
}
106
107
108
+ static void print_test_list (void ) {
109
+ int i ;
110
+ printf ("Available tests (%d):\n" , (int ) NUM_TESTS );
111
+ printf ("--------------------------------------------------\n" );
112
+ for (i = 0 ; i < (int ) NUM_TESTS ; i ++ ) {
113
+ printf (" [%3d] %s\n" , i + 1 , tests [i ].name );
114
+ }
115
+ printf ("--------------------------------------------------\n" );
116
+ printf ("Run with: ./tests <test_name>\n" );
117
+ }
118
+
107
119
static int parse_jobs_count (const char * key , const char * value , struct Args * out ) {
108
120
char * ptr_val ;
109
121
long val = strtol (value , & ptr_val , 10 ); /* base 10 */
@@ -327,6 +339,12 @@ int main(int argc, char** argv) {
327
339
_exit (EXIT_SUCCESS );
328
340
}
329
341
342
+ /* Check if we need to print the available tests */
343
+ if (argv [1 ] && strcmp (argv [1 ], "-print_tests" ) == 0 ) {
344
+ print_test_list ();
345
+ _exit (EXIT_SUCCESS );
346
+ }
347
+
330
348
/* Compatibility Note: The first two args were the number of iterations and the seed. */
331
349
/* If provided, parse them and adjust the starting index for named arguments accordingly. */
332
350
if (argv [1 ] && argv [1 ][0 ] != '-' ) {
0 commit comments