summaryrefslogtreecommitdiff
path: root/source4/torture/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/ui.c')
-rw-r--r--source4/torture/ui.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/source4/torture/ui.c b/source4/torture/ui.c
index 176f911845..35ff3cee7d 100644
--- a/source4/torture/ui.c
+++ b/source4/torture/ui.c
@@ -62,18 +62,31 @@ void torture_comment(struct torture_test *test, const char *comment, ...) _PRINT
void torture_ok(struct torture_test *test)
{
- test->context->ui_ops->test_result(test, TORTURE_OK);
+ test->context->ui_ops->test_result(test, TORTURE_OK, NULL);
test->context->success++;
}
-void torture_fail(struct torture_test *test)
+void torture_fail(struct torture_test *test, const char *fmt, ...) _PRINTF_ATTRIBUTE(2,3)
{
- test->context->ui_ops->test_result(test, TORTURE_FAIL);
+ va_list ap;
+ char *reason;
+ va_start(ap, fmt);
+ reason = talloc_vasprintf(test, fmt, ap);
+ va_end(ap);
+ test->context->ui_ops->test_result(test, TORTURE_FAIL, reason);
+ talloc_free(reason);
+
test->context->failed++;
}
-void torture_skip(struct torture_test *test)
+void torture_skip(struct torture_test *test, const char *fmt, ...) _PRINTF_ATTRIBUTE(2,3)
{
- test->context->ui_ops->test_result(test, TORTURE_SKIP);
+ va_list ap;
+ char *reason;
+ va_start(ap, fmt);
+ reason = talloc_vasprintf(test, fmt, ap);
+ va_end(ap);
+ test->context->ui_ops->test_result(test, TORTURE_SKIP, reason);
+ talloc_free(reason);
test->context->skipped++;
}