From 9884bf7d5737272db993b0602de85b12c2b4e0ea Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 3 Jun 2010 17:08:55 +0200 Subject: s4-smbtorture: allow to call single tests from a testcase in a testsuite directly on the commandline. Guenther --- source4/torture/smbtorture.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4') diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index baa9afebb6..d86e8dfe48 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -44,6 +44,7 @@ static bool run_matching(struct torture_context *torture, bool ret = true; struct torture_suite *o; struct torture_tcase *t; + struct torture_test *p; for (o = suite->children; o; o = o->next) { char *name = NULL; @@ -71,6 +72,15 @@ static bool run_matching(struct torture_context *torture, torture->active_testname = name; ret &= torture_run_tcase(torture, t); } + for (p = t->tests; p; p = p->next) { + name = talloc_asprintf(torture, "%s-%s-%s", prefix, t->name, p->name); + if (gen_fnmatch(expr, name) == 0) { + *matched = true; + reload_charcnv(torture->lp_ctx); + torture->active_testname = name; + ret &= torture_run_test(torture, t, p); + } + } } return ret; -- cgit