r19537: Report correct test names when tests failed.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 2 Nov 2006 22:17:11 +0000 (22:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:24:45 +0000 (14:24 -0500)
(This used to be commit 7b93b3c8be3d2a253b0737be893e7eb1b7c94dba)

source4/torture/smbtorture.c
source4/torture/ui.c

index 41ee1461d13b13cd13eadb9352ada8f7d82da48d..cf0340f3b2148bee51b2ee9cb630da558e486d8a 100644 (file)
@@ -64,10 +64,13 @@ static bool run_matching(struct torture_context *torture,
 
                for (c = suite->children; c; c = c->next) {
                        asprintf(&name, "%s-%s", prefix, c->name);
+
                        if (gen_fnmatch(expr, name) == 0) {
                                *matched = true;
                                init_iconv();
+                               torture->active_testname = talloc_strdup(torture, prefix);
                                ret &= torture_run_suite(torture, c);
+                               talloc_free(torture);
                                free(name);
                                continue;
                        }
@@ -82,7 +85,9 @@ static bool run_matching(struct torture_context *torture,
                        if (gen_fnmatch(expr, name) == 0) {
                                *matched = true;
                                init_iconv();
+                               torture->active_testname = talloc_strdup(torture, prefix);
                                ret &= torture_run_tcase(torture, t);
+                               talloc_free(torture->active_testname);
                        }
                        free(name);
                }
index 441e9ebbd7bed9e1099b98a1ba3f1bf7ca0639fb..84524ef9900e9470faf0a60d30d07fe7330dc8aa 100644 (file)
@@ -135,7 +135,7 @@ BOOL torture_run_suite(struct torture_context *context,
                context->ui_ops->suite_start(context, suite);
 
        old_testname = context->active_testname;
-       if (context->active_testname)
+       if (old_testname != NULL)
                context->active_testname = talloc_asprintf(context, "%s-%s", 
                                                                                           old_testname, suite->name);
        else