summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-10-17 19:36:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:20 -0500
commitac698cc2830992436cd3d188fb82cac9bb23c0d8 (patch)
tree4a75ac4fa97fea2bb0e65593ce5a5df8e0a9385c /source4/torture
parent1e818c463af84b6aeb462a7faa4c15603b7b90d7 (diff)
downloadsamba-ac698cc2830992436cd3d188fb82cac9bb23c0d8.tar.gz
samba-ac698cc2830992436cd3d188fb82cac9bb23c0d8.tar.bz2
samba-ac698cc2830992436cd3d188fb82cac9bb23c0d8.zip
r19378: Add another type of test result 'error'
(This used to be commit 77d13056bf437de77bfc94e21e9c945928e7f521)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/smbtorture.c9
-rw-r--r--source4/torture/ui.c8
-rw-r--r--source4/torture/ui.h6
3 files changed, 16 insertions, 7 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index ae4cfeb1de..5740829d7d 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -291,10 +291,12 @@ static void simple_test_result (struct torture_context *context,
case TORTURE_FAIL:
printf("TEST %s FAILED! - %s\n", context->active_test->name, reason);
break;
+ case TORTURE_ERROR:
+ printf("ERROR IN TEST %s! - %s\n", context->active_test->name, reason);
+ break;
case TORTURE_SKIP:
printf("SKIP: %s - %s\n", context->active_test->name, reason);
break;
-
}
}
@@ -329,6 +331,9 @@ static void subunit_test_result (struct torture_context *context,
case TORTURE_FAIL:
printf("failure: %s", context->active_test->name);
break;
+ case TORTURE_ERROR:
+ printf("error: %s", context->active_test->name);
+ break;
case TORTURE_SKIP:
printf("skip: %s", context->active_test->name);
break;
@@ -364,6 +369,7 @@ static void harness_test_result (struct torture_context *context,
printf("ok %s - %s\n", context->active_test->name, reason);
break;
case TORTURE_FAIL:
+ case TORTURE_ERROR:
printf("not ok %s - %s\n", context->active_test->name, reason);
break;
case TORTURE_SKIP:
@@ -407,6 +413,7 @@ static void quiet_test_result (struct torture_context *context,
switch (res) {
case TORTURE_OK: putchar('.'); break;
case TORTURE_FAIL: putchar('F'); break;
+ case TORTURE_ERROR: putchar('E'); break;
case TORTURE_SKIP: putchar('I'); break;
}
}
diff --git a/source4/torture/ui.c b/source4/torture/ui.c
index 24e229e873..670b151686 100644
--- a/source4/torture/ui.c
+++ b/source4/torture/ui.c
@@ -24,8 +24,7 @@
#include "torture/torture.h"
#include "lib/util/dlinklist.h"
-void torture_comment(struct torture_context *context,
- const char *comment, ...)
+void torture_comment(struct torture_context *context, const char *comment, ...)
{
va_list ap;
char *tmp;
@@ -172,6 +171,7 @@ void torture_ui_test_result(struct torture_context *context,
switch (result) {
case TORTURE_SKIP: context->skipped++; break;
+ case TORTURE_ERROR: context->errors++; break;
case TORTURE_FAIL: context->failed++; break;
case TORTURE_OK: context->success++; break;
}
@@ -205,8 +205,8 @@ static BOOL internal_torture_run_test(struct torture_context *context,
ret = test->run(context, tcase, test);
if (!ret) {
if (context->last_reason == NULL)
- context->last_reason = talloc_strdup(context, "...");
- context->last_result = TORTURE_FAIL;
+ context->last_reason = talloc_strdup(context, "Unknown error/failure");
+ context->last_result = TORTURE_ERROR;
}
torture_ui_test_result(context, context->last_result, context->last_reason);
diff --git a/source4/torture/ui.h b/source4/torture/ui.h
index c8a8d09a24..f0628b7758 100644
--- a/source4/torture/ui.h
+++ b/source4/torture/ui.h
@@ -29,8 +29,9 @@ struct torture_tcase;
enum torture_result {
TORTURE_OK=0,
- TORTURE_FAIL=1,
- TORTURE_SKIP=2
+ TORTURE_FAIL=1,
+ TORTURE_ERROR=2,
+ TORTURE_SKIP=3
};
/*
@@ -81,6 +82,7 @@ struct torture_context
int todo;
int success;
int failed;
+ int errors;
bool quiet; /* Whether tests should avoid writing output to stdout */