svn commit: samba r25743 - in branches/SAMBA_4_0: . source/selftest source/selftest/output

jelmer at samba.org jelmer at samba.org
Fri Oct 26 23:28:37 GMT 2007


Author: jelmer
Date: 2007-10-26 23:28:36 +0000 (Fri, 26 Oct 2007)
New Revision: 25743

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25743

Log:
Write short summary of failed tests and skipped tests to file.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/selftest/output/plain.pm
   branches/SAMBA_4_0/source/selftest/samba4_tests.sh
   branches/SAMBA_4_0/source/selftest/selftest.pl


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/selftest/output/plain.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/output/plain.pm	2007-10-26 21:25:43 UTC (rev 25742)
+++ branches/SAMBA_4_0/source/selftest/output/plain.pm	2007-10-26 23:28:36 UTC (rev 25743)
@@ -6,14 +6,16 @@
 
 use strict;
 
-sub new($$$$) {
-	my ($class, $verbose, $immediate, $statistics) = @_;
+sub new($$$$$) {
+	my ($class, $summaryfile, $verbose, $immediate, $statistics) = @_;
 	my $self = { 
 		verbose => $verbose, 
 		immediate => $immediate, 
 		statistics => $statistics,
 		test_output => {},
-		suitesfailed => []
+		suitesfailed => [],
+		skips => {},
+		summaryfile => $summaryfile,
 	};
 	bless($self, $class);
 }
@@ -102,12 +104,21 @@
 {
 	my ($self) = @_;
 
+	open(SUMMARY, ">$self->{summaryfile}");
+
+	if ($#{$self->{suitesfailed}} > -1) {
+		print SUMMARY "= Failed tests =\n";
+	}
+
 	if (not $self->{immediate} and not $self->{verbose}) {
 		foreach (@{$self->{suitesfailed}}) {
 			print "===============================================================================\n";
 			print "FAIL: $_\n";
 			print $self->{test_output}->{$_};
 			print "\n";
+
+			print SUMMARY "= $_ =\n";
+			print SUMMARY $self->{test_output}->{$_}."\n\n";
 		}
 	}
 
@@ -118,17 +129,25 @@
 	} else {
 		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($$)
 {
 	my ($self, $name, $reason) = @_;
 
-	if ($reason) {
-		print "SKIPPED: $name [$reason]\n";
-	} else {
-		print "SKIPPED: $name\n";
-	}
+	push (@{$self->{skips}->{$reason}}, $name);
 }
 
 1;

Modified: branches/SAMBA_4_0/source/selftest/samba4_tests.sh
===================================================================
--- branches/SAMBA_4_0/source/selftest/samba4_tests.sh	2007-10-26 21:25:43 UTC (rev 25742)
+++ branches/SAMBA_4_0/source/selftest/samba4_tests.sh	2007-10-26 23:28:36 UTC (rev 25743)
@@ -271,11 +271,11 @@
 WINBIND_NDR_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-NDR" | xargs`
 for env in dc member; 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
 
 	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
 

Modified: branches/SAMBA_4_0/source/selftest/selftest.pl
===================================================================
--- branches/SAMBA_4_0/source/selftest/selftest.pl	2007-10-26 21:25:43 UTC (rev 25742)
+++ branches/SAMBA_4_0/source/selftest/selftest.pl	2007-10-26 23:28:36 UTC (rev 25743)
@@ -736,7 +736,7 @@
 	$msg_ops = new output::buildfarm($statistics);
 } elsif ($opt_format eq "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") {
 	require output::html;
 	mkdir("test-results", 0777);



More information about the samba-cvs mailing list