Add tests for JSON and sudo-style log output.
This commit is contained in:
@@ -124,7 +124,7 @@ done:
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-c] input_file ...\n",
|
||||
fprintf(stderr, "usage: %s [-cv] input_file ...\n",
|
||||
getprogname());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -176,11 +176,14 @@ main(int argc, char *argv[])
|
||||
|
||||
initprogname(argc > 0 ? argv[0] : "check_parse_json");
|
||||
|
||||
while ((ch = getopt(argc, argv, "c")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "cv")) != -1) {
|
||||
switch (ch) {
|
||||
case 'c':
|
||||
cat = true;
|
||||
break;
|
||||
case 'v':
|
||||
/* ignored */
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
@@ -258,8 +261,8 @@ next:
|
||||
}
|
||||
|
||||
if (ntests != 0) {
|
||||
printf("iolog_json: %d test%s run, %d errors, %d%% success rate\n",
|
||||
ntests, ntests == 1 ? "" : "s", errors,
|
||||
printf("%s: %d test%s run, %d errors, %d%% success rate\n",
|
||||
getprogname(), ntests, ntests == 1 ? "" : "s", errors,
|
||||
(ntests - errors) * 100 / ntests);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user