------------------------------------------------------------
revno: 11294
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: 4.0-perlselftest
timestamp: Thu 2007-01-25 13:35:59 +0100
message:
  Less verbose output when not running in the buildfarm
modified:
  source/script/tests/selftest.pl svn-v2:[EMAIL PROTECTED]
=== modified file 'source/script/tests/selftest.pl'
--- a/source/script/tests/selftest.pl   2007-01-25 11:37:20 +0000
+++ b/source/script/tests/selftest.pl   2007-01-25 12:35:59 +0000
@@ -92,6 +92,7 @@
 my $opt_quick = 0;
 my $opt_socket_wrapper = 0;
 my $opt_one = 0;
+my $opt_immediate = 0;
 
 sub slapd_start($$) {
        my ($conf, $uri) = @_;
@@ -158,20 +159,6 @@
        return $pid;
 }
 
-sub teststatus($$) {
-       my ($name, $failed) = @_;
-
-       if ($failed > 0) {
-print <<EOF        
-************************
-*** TESTSUITE FAILED ***
-************************
-EOF
-;
-       }
-       exit $failed;
-}
-
 my $suitesfailed = [];
 my $totalfailed = 0;
 my $totalsuccesses = 0;
@@ -222,13 +209,16 @@
                        delete $open_tests->{$1};
                        $totalfailed++;
                }
-               $test_output->{$_}.=$_;
+               $test_output->{$name}.=$_;
        }
        $test_output->{$name}.="COMMAND IS: $cmd\n";
        foreach (keys %$open_tests) {
                print "$_ was started but never finished!\n";           
        }
        my $ret = close(RESULT);
+       if ($opt_immediate or (not $ret and $opt_one)) {
+               print "$test_output->{$name}\n";
+       }
        if (not $ret) {
                push(@$suitesfailed, $name);
                exit(1) if ($opt_one);
@@ -257,6 +247,7 @@
  --socket-wrapper           enable socket wrapper
  --quick                    run quick overall test
  --one                      abort when the first test fails
+ --immediate                print test output for failed tests during run
 ";
        exit(0);
 }
@@ -267,7 +258,8 @@
                'target=s' => \$opt_target,
                'socket-wrapper' => \$opt_socket_wrapper,
                'quick' => \$opt_quick,
-               'one' => \$opt_one
+               'one' => \$opt_one,
+               'immediate' => \$opt_immediate
            );
 
 if (not $result) {
@@ -485,15 +477,24 @@
 } else {
 
        unless ($from_build_farm) {
-               foreach (@$suitesfailed) {
-                       print 
"================================================\n";
-                       print "FAIL: $_\n";
-                       print $test_output->{$_};
-                       print "\n";
+               if (not $opt_immediate) {
+                       foreach (@$suitesfailed) {
+                               print 
"===============================================================================\n";
+                               print "FAIL: $_\n";
+                               print $test_output->{$_};
+                               print "\n";
+                       }
                }
+
+               print "FAILED ($totalfailed tests in $numfailed testsuites)\n";
+       } else {
+               print <<EOF         
+************************
+*** TESTSUITE FAILED ***
+************************
+EOF
+;
        }
-
-       print "$totalfailed failed tests in $numfailed testsuites\n";
 }
 
 # if there were any valgrind failures, show them
@@ -507,6 +508,4 @@
        }
 }
 
-teststatus($Script, $numfailed);
-
 exit $numfailed;

Reply via email to