summaryrefslogtreecommitdiff
path: root/source4/torture/ui.h
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-03-05 21:28:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:15 -0500
commit72d88d158a6e82392116bab09ce8704115072d07 (patch)
tree784921beb62ef9299515fb6910a3de3bff4ebbc0 /source4/torture/ui.h
parentd18afd6aeec0831a46d75470383e7eb7bdfd8de5 (diff)
downloadsamba-72d88d158a6e82392116bab09ce8704115072d07.tar.gz
samba-72d88d158a6e82392116bab09ce8704115072d07.tar.bz2
samba-72d88d158a6e82392116bab09ce8704115072d07.zip
r21707: Finally merge my (long-living) perlselftest branch.
This changes the main selftest code to be in perl rather than in shell script. The selftest script is now no longer a black box but a regular executable that takes --help. This adds the following features: * "make test TESTS=foo" will run only the tests that match the regex "foo" * ability to deal with expected failures. the suite will not warn about tests that fail and are known to fail, but will warn about other failing tests and tests that are succeeding tests but incorrectly marked as failing. * ability to print a summary with all failures at the end of the run It also opens up the way to the following features, which I hope to implement later: * "environments", for example having a complete domains with DCs and domain members in a testenvironment * only set up smbd if necessary (not when running LOCAL tests, for example) * different mktestsetup scripts per target. except for the mktestsetup script, we can use the same infrastructure for samba 3 or windows. (This used to be commit 38f867880beb40c691e9713f854426031310629c)
Diffstat (limited to 'source4/torture/ui.h')
-rw-r--r--source4/torture/ui.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/torture/ui.h b/source4/torture/ui.h
index 8c4d3b6729..329462ba28 100644
--- a/source4/torture/ui.h
+++ b/source4/torture/ui.h
@@ -40,7 +40,9 @@ enum torture_result {
*/
struct torture_ui_ops
{
+ void (*init) (struct torture_context *);
void (*comment) (struct torture_context *, const char *);
+ void (*warning) (struct torture_context *, const char *);
void (*suite_start) (struct torture_context *, struct torture_suite *);
void (*suite_finish) (struct torture_context *, struct torture_suite *);
void (*tcase_start) (struct torture_context *, struct torture_tcase *);
@@ -188,6 +190,7 @@ bool torture_run_test(struct torture_context *context,
struct torture_test *test);
void torture_comment(struct torture_context *test, const char *comment, ...) PRINTF_ATTRIBUTE(2,3);
+void torture_warning(struct torture_context *test, const char *comment, ...) PRINTF_ATTRIBUTE(2,3);
void torture_result(struct torture_context *test,
enum torture_result, const char *reason, ...) PRINTF_ATTRIBUTE(3,4);
@@ -263,6 +266,10 @@ void torture_result(struct torture_context *test,
torture_result(torture_ctx, TORTURE_FAIL, __location__": %s", cmt);\
return false; \
} while (0)
+#define torture_fail_goto(torture_ctx,label,cmt) do {\
+ torture_result(torture_ctx, TORTURE_FAIL, __location__": %s", cmt);\
+ goto label; \
+ } while (0)
#define torture_out stderr