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

jelmer at samba.org jelmer at samba.org
Sun Sep 2 00:24:40 GMT 2007


Author: jelmer
Date: 2007-09-02 00:24:38 +0000 (Sun, 02 Sep 2007)
New Revision: 24878

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

Log:
Support specifying a reason for skips/expected failures
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/samba4-skip
   branches/SAMBA_4_0/source/selftest/output/buildfarm.pm
   branches/SAMBA_4_0/source/selftest/output/html.pm
   branches/SAMBA_4_0/source/selftest/output/plain.pm
   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/samba4-skip
===================================================================
--- branches/SAMBA_4_0/source/samba4-skip	2007-09-02 00:23:02 UTC (rev 24877)
+++ branches/SAMBA_4_0/source/samba4-skip	2007-09-02 00:24:38 UTC (rev 24878)
@@ -7,7 +7,7 @@
 BASE-SAMBA3ERROR
 BASE-CASETABLE
 BASE-NTTRANS
-BASE-BENCH-HOLDCON
+.*BASE-BENCH-HOLDCON.*				# Very slow
 BASE-SCAN-MAXFID
 RAW-BENCH-OPLOCK
 RAW-HOLD-OPLOCK
@@ -24,7 +24,6 @@
 ntvfs/cifs BASE-IOMETER
 ntvfs/cifs BASE-CASETABLE
 ntvfs/cifs BASE-NTTRANS
-ntvfs/cifs BASE-BENCH-HOLDCON
 ntvfs/cifs BASE-SCAN-MAXFID
 ntvfs/cifs BASE-UTABLE
 ntvfs/cifs BASE-SMB
@@ -38,5 +37,5 @@
 RPC-DSSYNC
 RPC-SAMSYNC
 LDAP-UPTODATEVECTOR
-RPC-SCANNER
-.*SAMBA3.*
+RPC-SCANNER							# Very slow
+.*SAMBA3.*							# Samba3-specific test

Modified: branches/SAMBA_4_0/source/selftest/output/buildfarm.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/output/buildfarm.pm	2007-09-02 00:23:02 UTC (rev 24877)
+++ branches/SAMBA_4_0/source/selftest/output/buildfarm.pm	2007-09-02 00:24:38 UTC (rev 24878)
@@ -99,11 +99,15 @@
 	print "FAIL: $name (ENV[$envname] not available!)\n";
 }
 
-sub skip_testsuite($$$)
+sub skip_testsuite($$$$)
 {
-	my ($self, $envname, $name) = @_;
+	my ($self, $envname, $name, $reason) = @_;
 
-	print "SKIPPED: $name\n";
+	if ($reason) {
+		print "SKIPPED: $name [$reason]\n";
+	} else {
+		print "SKIPPED: $name\n";
+	}
 }
 
 1;

Modified: branches/SAMBA_4_0/source/selftest/output/html.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/output/html.pm	2007-09-02 00:23:02 UTC (rev 24877)
+++ branches/SAMBA_4_0/source/selftest/output/html.pm	2007-09-02 00:24:38 UTC (rev 24878)
@@ -315,14 +315,18 @@
 	print INDEX "</tr>\n";
 }
 
-sub skip_testsuite($$$)
+sub skip_testsuite($$$$)
 {
-	my ($self, $envname, $name) = @_;
+	my ($self, $envname, $name, $reason) = @_;
 
 	print INDEX "<tr>\n";
 	print INDEX "  <td class=\"testSuite\">$name</td>\n";
 	print INDEX "  <td class=\"environment\">$envname</td>\n";
-	print INDEX "  <td class=\"resultSkipped\">SKIPPED</td>\n";
+	if ($reason) {
+		print INDEX "  <td class=\"resultSkipped\">SKIPPED - $reason</td>\n";
+	} else {
+		print INDEX "  <td class=\"resultSkipped\">SKIPPED</td>\n";
+	}
 	print INDEX "</tr>\n";
 }
 

Modified: branches/SAMBA_4_0/source/selftest/output/plain.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/output/plain.pm	2007-09-02 00:23:02 UTC (rev 24877)
+++ branches/SAMBA_4_0/source/selftest/output/plain.pm	2007-09-02 00:24:38 UTC (rev 24878)
@@ -113,9 +113,13 @@
 
 sub skip_testsuite($$$)
 {
-	my ($self, $envname, $name) = @_;
+	my ($self, $envname, $name, $reason) = @_;
 
-	print "SKIPPED: $name\n";
+	if ($reason) {
+		print "SKIPPED: $name [$reason]\n";
+	} else {
+		print "SKIPPED: $name\n";
+	}
 }
 
 1;

Modified: branches/SAMBA_4_0/source/selftest/selftest.pl
===================================================================
--- branches/SAMBA_4_0/source/selftest/selftest.pl	2007-09-02 00:23:02 UTC (rev 24877)
+++ branches/SAMBA_4_0/source/selftest/selftest.pl	2007-09-02 00:24:38 UTC (rev 24878)
@@ -161,26 +161,30 @@
 	TESTS_SKIP => 0,
 };
 
-sub expecting_failure($)
+sub find_in_list($$)
 {
-	my $fullname = shift;
+	my ($list, $fullname) = @_;
 
-	foreach (@expected_failures) {
-		return 1 if ($fullname =~ /$_/);
+	foreach (@$list) {
+		if ($fullname =~ /$$_[0]/) {
+			 return ($$_[1]) if ($$_[1]);
+			 return "NO REASON SPECIFIED";
+		}
 	}
 
-	return 0;
+	return undef;
 }
 
+sub expecting_failure($)
+{
+	my ($name) = @_;
+	return find_in_list(\@expected_failures, $name);
+}
+
 sub skip($)
 {
-	my $fullname = shift;
-
-	foreach (@skips) {
-		return 1 if ($fullname =~ /$_/);
-	}
-
-	return 0;
+	my ($name) = @_;
+	return find_in_list(\@skips, $name);
 }
 
 sub getlog_env($);
@@ -420,22 +424,30 @@
 	$target = new Windows();
 }
 
-if (defined($opt_expected_failures)) {
-	open(KNOWN, "<$opt_expected_failures") or die("unable to read known failures file: $!");
-	while (<KNOWN>) { 
+sub read_test_regexes($)
+{
+	my ($name) = @_;
+	my @ret = ();
+	open(LF, "<$name") or die("unable to read $name: $!");
+	while (<LF>) { 
 		chomp; 
-		s/([ \t]+)\#(.*)$//;
-		push (@expected_failures, $_); }
-	close(KNOWN);
+		if (/^(.*?)([ \t]+)\#(.*)$/) {
+			push (@ret, [$1, $3]);
+		} else {
+			s/^(.*?)([ \t]+)\#(.*)$//;
+			push (@ret, [$_, undef]); 
+		}
+	}
+	close(LF);
+	return @ret;
 }
 
+if (defined($opt_expected_failures)) {
+	@expected_failures = read_test_regexes($opt_expected_failures);
+}
+
 if (defined($opt_skip)) {
-	open(SKIP, "<$opt_skip") or die("unable to read skip file: $!");
-	while (<SKIP>) { 
-		chomp; 
-		s/([ \t]+)\#(.*)$//;
-		push (@skips, $_); }
-	close(SKIP);
+	@skips = read_test_regexes($opt_skip);
 }
 
 my $interfaces = join(',', ("127.0.0.6/8", 
@@ -697,16 +709,16 @@
 		my $name = $$_[0];
 		my $envname = $$_[1];
 		
-		if (skip($name)) {
-			$msg_ops->skip_testsuite($envname, $name);
+		my $skipreason = skip($name);
+		if ($skipreason) {
+			$msg_ops->skip_testsuite($envname, $name, $skipreason);
 			$statistics->{SUITES_SKIPPED}++;
 			next;
 		}
 
 		my $envvars = setup_env($envname);
 		if (not defined($envvars)) {
-			$statistics->{SUITES_FAIL}++;
-			$statistics->{TESTS_ERROR}++;
+			$statistics->{SUITES_SKIPPED}++;
 			$msg_ops->missing_env($name, $envname);
 			next;
 		}



More information about the samba-cvs mailing list