Rev 11294: Less verbose output when not running in the buildfarm in
file:///home/jelmer/bzr.samba/4.0-perlselftest/
Jelmer Vernooij
jelmer at samba.org
Thu Jan 25 12:42:30 GMT 2007
------------------------------------------------------------
revno: 11294
revision-id: jelmer at samba.org-20070125123559-fz1orjr1s14txh91
parent: jelmer at samba.org-20070125113720-djp3pkd40b1c3u9z
committer: Jelmer Vernooij <jelmer at samba.org>
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:20693 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fscript%2ftests%2fselftest.pl
=== 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;
More information about the samba-cvs
mailing list