1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r25743: Write short summary of failed tests and skipped tests to file.

This commit is contained in:
Jelmer Vernooij 2007-10-26 23:28:36 +02:00 committed by Stefan Metzmacher
parent f2319fbe9b
commit 22cb93e5c0
3 changed files with 30 additions and 11 deletions

View File

@ -6,14 +6,16 @@ use Exporter;
use strict; use strict;
sub new($$$$) { sub new($$$$$) {
my ($class, $verbose, $immediate, $statistics) = @_; my ($class, $summaryfile, $verbose, $immediate, $statistics) = @_;
my $self = { my $self = {
verbose => $verbose, verbose => $verbose,
immediate => $immediate, immediate => $immediate,
statistics => $statistics, statistics => $statistics,
test_output => {}, test_output => {},
suitesfailed => [] suitesfailed => [],
skips => {},
summaryfile => $summaryfile,
}; };
bless($self, $class); bless($self, $class);
} }
@ -102,12 +104,21 @@ sub summary($)
{ {
my ($self) = @_; my ($self) = @_;
open(SUMMARY, ">$self->{summaryfile}");
if ($#{$self->{suitesfailed}} > -1) {
print SUMMARY "= Failed tests =\n";
}
if (not $self->{immediate} and not $self->{verbose}) { if (not $self->{immediate} and not $self->{verbose}) {
foreach (@{$self->{suitesfailed}}) { foreach (@{$self->{suitesfailed}}) {
print "===============================================================================\n"; print "===============================================================================\n";
print "FAIL: $_\n"; print "FAIL: $_\n";
print $self->{test_output}->{$_}; print $self->{test_output}->{$_};
print "\n"; print "\n";
print SUMMARY "= $_ =\n";
print SUMMARY $self->{test_output}->{$_}."\n\n";
} }
} }
@ -118,17 +129,25 @@ sub summary($)
} else { } else {
print "FAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n"; print "FAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n";
} }
print SUMMARY "= Skipped tests =\n";
foreach my $reason (keys %{$self->{skips}}) {
print SUMMARY "$reason\n";
foreach my $name (@{$self->{skips}->{$reason}}) {
print SUMMARY "\t$name\n";
}
print SUMMARY "\n";
}
close(SUMMARY);
print "A summary can be found in $self->{summaryfile}\n";
} }
sub skip_testsuite($$) sub skip_testsuite($$)
{ {
my ($self, $name, $reason) = @_; my ($self, $name, $reason) = @_;
if ($reason) { push (@{$self->{skips}->{$reason}}, $name);
print "SKIPPED: $name [$reason]\n";
} else {
print "SKIPPED: $name\n";
}
} }
1; 1;

View File

@ -271,11 +271,11 @@ WINBIND_STRUCT_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-STRUCT" |
WINBIND_NDR_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-NDR" | xargs` WINBIND_NDR_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-NDR" | xargs`
for env in dc member; do for env in dc member; do
for t in $WINBIND_STRUCT_TESTS; do for t in $WINBIND_STRUCT_TESTS; do
plantest "$ENVNAME:$t" $ENVNAME $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t plantest $t $env $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t
done done
for t in $WINBIND_NDR_TESTS; do for t in $WINBIND_NDR_TESTS; do
plantest "$ENVNAME:$t" $ENVNAME $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t plantest $t $env $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t
done done
done done

View File

@ -736,7 +736,7 @@ if ($opt_format eq "buildfarm") {
$msg_ops = new output::buildfarm($statistics); $msg_ops = new output::buildfarm($statistics);
} elsif ($opt_format eq "plain") { } elsif ($opt_format eq "plain") {
require output::plain; require output::plain;
$msg_ops = new output::plain($opt_verbose, $opt_immediate, $statistics); $msg_ops = new output::plain("$prefix/summary", $opt_verbose, $opt_immediate, $statistics);
} elsif ($opt_format eq "html") { } elsif ($opt_format eq "html") {
require output::html; require output::html;
mkdir("test-results", 0777); mkdir("test-results", 0777);