Commit a9c33747 authored by Mark Andrews's avatar Mark Andrews
Browse files

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

parent 76837484
...@@ -1550,12 +1550,21 @@ main(int argc, char **argv) { ...@@ -1550,12 +1550,21 @@ main(int argc, char **argv) {
_teardown), _teardown),
}; };
struct CMUnitTest selected[sizeof(tests) / sizeof(tests[0])]; struct CMUnitTest selected[sizeof(tests) / sizeof(tests[0])];
size_t i;
int c; int c;
memset(selected, 0, sizeof(selected)); 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) { 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': case 't':
if (!cmocka_add_test_byname( if (!cmocka_add_test_byname(
tests, isc_commandline_argument, selected)) tests, isc_commandline_argument, selected))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment