2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Add the ability to print out the list of test names (-l)

This commit is contained in:
Mark Andrews
2020-09-08 10:38:24 +10:00
parent 76837484e7
commit a9c3374717

View File

@@ -1550,12 +1550,21 @@ main(int argc, char **argv) {
_teardown),
};
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))