subunit: Make sure "]" in failure reason ends up on its own line, so the
authorJelmer Vernooij <jelmer@samba.org>
Thu, 26 Aug 2010 01:50:08 +0000 (03:50 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 26 Aug 2010 02:04:37 +0000 (04:04 +0200)
next subunit parser in the line parses it correctly.

selftest/Subunit.pm
selftest/subunithelper.py

index 42a9ad08aafaf0ba3e3283d70c7fdf67bcbaeab7..d5c8277fcaa9decb4fa37f8b76d8fbeb805dbe22 100644 (file)
@@ -52,8 +52,8 @@ sub parse_results($$$)
                                
                                unless ($terminated) {
                                        $statistics->{TESTS_ERROR}++;
-                                       $msg_ops->end_test($testname, "error", 1, 
-                                                              "reason ($result) interrupted");
+                                       $msg_ops->end_test($testname, "error", 1,
+                                                              "reason ($result) interrupted\n");
                                        return 1;
                                }
                        }
@@ -102,7 +102,7 @@ sub parse_results($$$)
 
        while ($#$open_tests+1 > 0) {
                $msg_ops->end_test(pop(@$open_tests), "error", 1,
-                                  "was started but never finished!");
+                                  "was started but never finished!\n");
                $statistics->{TESTS_ERROR}++;
        }
 
@@ -132,7 +132,8 @@ sub end_test($$;$)
        my $reason = shift;
        if ($reason) {
                print "$result: $name [\n";
-               print "$reason";
+               print $reason;
+               if (substr($reason, -1, 1) != "\n") { print "\n"; }
                print "]\n";
        } else {
                print "$result: $name\n";
index d0bb0bb5330b12d60a16073b9bd97c5b512b5532..06e1fc2edc31f55d7e070462af6137c30a267f55 100644 (file)
@@ -66,7 +66,7 @@ def parse_results(msg_ops, statistics, fh):
                         break
                     else:
                         reason += l
-                
+
                 if not terminated:
                     statistics['TESTS_ERROR']+=1
                     msg_ops.end_test(testname, "error", True, 
@@ -167,7 +167,7 @@ class SubunitOps(object):
     def end_test(self, name, result, reason=None):
         if reason:
             print "%s: %s [" % (result, name)
-            print "%s" % reason
+            print reason
             print "]"
         else:
             print "%s: %s" % (result, name)