r25465: improve plain output...
authorStefan Metzmacher <metze@samba.org>
Tue, 2 Oct 2007 15:53:26 +0000 (15:53 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:07:41 +0000 (15:07 -0500)
metze

source/selftest/output/plain.pm

index 12236e518fcfeb6a6b3462920fd3c166e26cba0a..e4abb2d05aadbc2f61bb20a52580c31c2ac2b15d 100644 (file)
@@ -81,16 +81,21 @@ sub start_test($$)
 sub end_test($$$$$$)
 {
        my ($self, $state, $testname, $result, $unexpected, $reason) = @_;
+       my $append = "";
 
-       if ($unexpected and $self->{immediate} and not $self->{verbose}) {
-               if ($reason) {
-                       print "$testname: $result [ $reason ]\n";
-               } else {
-                       print "$testname: $result\n";
-               }
-               print $self->{test_output}->{$state->{NAME}}."\n";
+       unless ($unexpected) {
+               $self->{test_output}->{$state->{NAME}} = "";
+               return;
+       }
+
+       $append = "UNEXPECTED($result): $testname\n";
+
+       $self->{test_output}->{$state->{NAME}} .= $append;
+
+       if ($self->{immediate} and not $self->{verbose}) {
+               print $self->{test_output}->{$state->{NAME}};
+               $self->{test_output}->{$state->{NAME}} = "";
        }
-       $self->{test_output}->{$state->{NAME}} = "";
 }
 
 sub summary($)