On 08/01/2015 07:13 PM, Andrew Dunstan wrote:

On 08/01/2015 04:44 PM, Noah Misch wrote:

--enable-tap-tests is a reasonable configuration setting, because it's
about whether or not we have a TAP testing framework available, but I
think we should stop calling the bin tests "TAP tests" and we should
change the test name in vcregress.pl to a more appropriate name. In the buildfarm I'm calling the step "bin-check": <http://www.pgbuildfarm.org/cgi-bin/show_stage_log.pl?nm=crake&dt=2015-07-30%2012%3A25%3A58&stg=bin-check>

Thoughts?
While lack of granularity in vcregress.pl is hostile, with so much about MSVC
development being hostile, this one is below my noise floor.


Speaking with my buildfarm hat on, it's well above mine. And these changes make the situation worse quite gratuitously. Anyway, I'll fix it.





here's what I propose.

cheers

andrew


diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index d3d736b..b50a160 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -34,7 +34,7 @@ if (-e "src/tools/msvc/buildenv.pl")
 
 my $what = shift || "";
 if ($what =~
-/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|tapcheck)$/i
+/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck)$/i
   )
 {
 	$what = uc $what;
@@ -61,7 +61,14 @@ unless ($schedule)
 	$schedule = "parallel" if ($what eq 'CHECK' || $what =~ /PARALLEL/);
 }
 
-$ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}";
+if ($ENV{PERL5LIB})
+{
+	$ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}";
+}
+else
+{
+	$ENV{PERL5LIB} = "$topdir/src/tools/msvc";
+}
 
 my $maxconn = "";
 $maxconn = "--max_connections=$ENV{MAX_CONNECTIONS}"
@@ -81,7 +88,7 @@ my %command = (
 	CONTRIBCHECK   => \&contribcheck,
 	MODULESCHECK   => \&modulescheck,
 	ISOLATIONCHECK => \&isolationcheck,
-	TAPCHECK       => \&tapcheck,
+	BINCHECK       => \&bincheck,
 	UPGRADECHECK   => \&upgradecheck,);
 
 my $proc = $command{$what};
@@ -168,44 +175,46 @@ sub isolationcheck
 	exit $status if $status;
 }
 
-sub tapcheck
+sub tap_check
 {
-	InstallTemp();
+	die "Tap tests not enabled in configuration"
+	  unless $config->{tap_tests};
+
+	my $dir = shift;
+	chdir $dir;
 
 	my @args = ( "prove", "--verbose", "t/*.pl");
-	my $mstat = 0;
 
+	# Reset those values, they may have been changed by another test.
+	# XXX is this true?
+	local %ENV = %ENV;
 	$ENV{PERL5LIB} = "$topdir/src/test/perl;$ENV{PERL5LIB}";
 	$ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress";
 
+	$ENV{TESTDIR} = "$dir";
+
+	system(@args);
+	my $status = $? >> 8;
+	return $status;
+}
+
+sub bincheck
+{
+	InstallTemp();
+
+	my $mstat = 0;
+
 	# Find out all the existing TAP tests by looking for t/ directories
 	# in the tree.
-	my $tap_dirs = [];
-	my @top_dir = ($topdir);
-	File::Find::find(
-		{   wanted => sub {
-				/^t\z/s
-				  && push(@$tap_dirs, $File::Find::name);
-			  }
-		},
-		@top_dir);
+	my @bin_dirs = glob("$topdir/src/bin/*");
 
 	# Process each test
-	foreach my $test_path (@$tap_dirs)
+	foreach my $dir (@$tap_dirs)
 	{
-		# Like on Unix "make check-world", don't run the SSL test suite
-		# automatically.
-		next if ($test_path =~ /\/src\/test\/ssl\//);
-
-		my $dir = dirname($test_path);
-		chdir $dir;
-		# Reset those values, they may have been changed by another test.
-		$ENV{TESTDIR} = "$dir";
-		system(@args);
-		my $status = $? >> 8;
-		$mstat ||= $status;
+		next unless -d "$dir/t";
+		my $status = tap_check($dir);
+		exit $status if $status;
 	}
-	exit $mstat if $mstat;
 }
 
 sub plcheck
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to