summaryrefslogtreecommitdiff
path: root/source4/torture/smbtorture.c
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/smbtorture.c
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/smbtorture.c')
-rw-r--r--source4/torture/smbtorture.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index cc4c3e6b5b..5247abc14b 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -316,13 +316,25 @@ static void simple_comment (struct torture_context *test,
printf("%s", comment);
}
+static void simple_warning(struct torture_context *test,
+ const char *comment)
+{
+ fprintf(stderr, "WARNING: %s\n", comment);
+}
+
const static struct torture_ui_ops std_ui_ops = {
.comment = simple_comment,
+ .warning = simple_warning,
.suite_start = simple_suite_start,
.suite_finish = simple_suite_finish,
.test_result = simple_test_result
};
+static void subunit_init(struct torture_context *ctx)
+{
+ /* FIXME: register segv and bus handler */
+}
+
static void subunit_suite_start(struct torture_context *ctx,
struct torture_suite *suite)
{
@@ -354,7 +366,7 @@ static void subunit_test_result (struct torture_context *context,
break;
}
if (reason)
- printf(" [ %s ]", reason);
+ printf(" [\n%s\n]", reason);
printf("\n");
}
@@ -365,6 +377,7 @@ static void subunit_comment (struct torture_context *test,
}
const static struct torture_ui_ops subunit_ui_ops = {
+ .init = subunit_init,
.comment = subunit_comment,
.test_start = subunit_test_start,
.test_result = subunit_test_result,