]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add the ability to print out the list of test names (-l)
authorMark Andrews <marka@isc.org>
Tue, 8 Sep 2020 00:38:24 +0000 (10:38 +1000)
committerMark Andrews <marka@isc.org>
Thu, 1 Oct 2020 13:03:05 +0000 (23:03 +1000)
(cherry picked from commit a9c337471767b75861557c93b4fd7fff66227de0)

lib/isc/tests/task_test.c

index 24a325c05ccc822f7477482955bd0dc997da4125..151a9ea7b2345890609a28a297f184f2431d9f8f 100644 (file)
@@ -1572,12 +1572,21 @@ main(int argc, char **argv) {
 #endif
        };
        struct CMUnitTest selected[sizeof(tests) / sizeof(tests[0])];
+       size_t i;
        int c;
 
        memset(selected, 0, sizeof(selected));
 
-       while ((c = isc_commandline_parse(argc, argv, "t:v")) != -1) {
+       while ((c = isc_commandline_parse(argc, argv, "lt:v")) != -1) {
                switch (c) {
+               case 'l':
+                       for (i = 0; i < (sizeof(tests) / sizeof(tests[0])); i++)
+                       {
+                               if (tests[i].name != NULL) {
+                                       fprintf(stdout, "%s\n", tests[i].name);
+                               }
+                       }
+                       return (0);
                case 't':
                        if (!cmocka_add_test_byname(
                                    tests, isc_commandline_argument, selected))