diff options
Diffstat (limited to 'source4/torture/smbtorture.c')
-rw-r--r-- | source4/torture/smbtorture.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index d588e124fd..97b6ab2c65 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -267,7 +267,7 @@ static void subunit_test_result (struct torture_test *test, enum torture_result printf("success: %s\n", test->name); break; case TORTURE_FAIL: - printf("failure: %s\n", test->name); + printf("failure: %s [ %s ]\n", test->name, reason); break; case TORTURE_TODO: printf("todo: %s\n", test->name); @@ -289,6 +289,39 @@ const static struct torture_ui_ops subunit_ui_ops = { .test_result = subunit_test_result }; +static void harness_test_start (struct torture_test *test) +{ +} + +static void harness_test_result (struct torture_test *test, enum torture_result res, const char *reason) +{ + switch (res) { + case TORTURE_OK: + printf("ok %s - %s\n", test->name, reason); + break; + case TORTURE_FAIL: + printf("not ok %s - %s\n", test->name, reason); + break; + case TORTURE_TODO: + printf("todo %s - %s\n", test->name, reason); + break; + case TORTURE_SKIP: + printf("skip %s - %s\n", test->name, reason); + break; + } +} + +static void harness_comment (struct torture_test *test, const char *comment) +{ + printf("# %s\n", comment); +} + +const static struct torture_ui_ops harness_ui_ops = { + .comment = harness_comment, + .test_start = harness_test_start, + .test_result = harness_test_result +}; + /**************************************************************************** main program ****************************************************************************/ @@ -308,7 +341,7 @@ const static struct torture_ui_ops subunit_ui_ops = { struct poptOption long_options[] = { POPT_AUTOHELP - {"format", 0, POPT_ARG_STRING, &ui_ops_name, 0, "Output format (one of: simple, subunit)", NULL }, + {"format", 0, POPT_ARG_STRING, &ui_ops_name, 0, "Output format (one of: simple, subunit, harness)", NULL }, {"smb-ports", 'p', POPT_ARG_STRING, NULL, OPT_SMB_PORTS, "SMB ports", NULL}, {"seed", 0, POPT_ARG_INT, &torture_seed, 0, "seed", NULL}, {"num-progs", 0, POPT_ARG_INT, &torture_nprocs, 0, "num progs", NULL}, @@ -442,6 +475,8 @@ const static struct torture_ui_ops subunit_ui_ops = { torture->ui_ops = &std_ui_ops; } else if (!strcmp(ui_ops_name, "subunit")) { torture->ui_ops = &subunit_ui_ops; + } else if (!strcmp(ui_ops_name, "harness")) { + torture->ui_ops = &harness_ui_ops; } else { printf("Unknown output format '%s'\n", ui_ops_name); exit(1); |