Add -v option parsing to regress tests, currently a no-op.
This will be used by a "check-verbose" target in the future.
This commit is contained in:
@@ -61,12 +61,24 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct strtobool_data *d;
|
||||
int errors = 0;
|
||||
int ntests = 0;
|
||||
int value;
|
||||
int errors = 0, ntests = 0;
|
||||
int ch, value;
|
||||
|
||||
initprogname(argc > 0 ? argv[0] : "strtobool_test");
|
||||
|
||||
while ((ch = getopt(argc, argv, "v")) != -1) {
|
||||
switch (ch) {
|
||||
case 'v':
|
||||
/* ignore */
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "usage: %s [-v]\n", getprogname());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
for (d = strtobool_data; d->bool_str != NULL; d++) {
|
||||
ntests++;
|
||||
value = sudo_strtobool(d->bool_str);
|
||||
|
Reference in New Issue
Block a user