On 2/24/15 3:06 AM, Michael Paquier wrote:
> On Sun, Feb 15, 2015 at 11:01 AM, Peter Eisentraut wrote:
>> Here is an updated patch.
> 
> Nice patch. This is going to save a lot of resources.
> 
> An update of vcregress.pl is necessary. This visibly just consists in
> updating the options that have been renamed in pg_regress (don't mind
> testing any code sent out).

Well, that turns out to be more complicated than initially thought.
Apparently, the msvc has a bit of a different idea of what check and
installcheck do with respect to temporary installs.  For instance,
vcregress installcheck does not use psql from the installation but from
the build tree.  vcregress check uses psql from the build tree but other
binaries (initdb, pg_ctl) from the temporary installation.  It is hard
for me to straighten this out by just looking at the code.  Attached is
a patch that shows the idea, but I can't easily take it further than that.

> -               {"top-builddir", required_argument, NULL, 11},
> +               {"datadir", required_argument, NULL, 12},
> In pg_regress.c datadir is a new option but it is used nowhere, so it
> could be as well removed.

Yeah, that's an oversight that is easily corrected.


diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index bd3dd2c..1e09c74 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -94,7 +94,7 @@ sub installcheck
 	my @args = (
 		"../../../$Config/pg_regress/pg_regress",
 		"--dlpath=.",
-		"--psqldir=../../../$Config/psql",
+		"--bindir=../../../$Config/psql",
 		"--schedule=${schedule}_schedule",
 		"--encoding=SQL_ASCII",
 		"--no-locale");
@@ -106,39 +106,56 @@ sub installcheck
 
 sub check
 {
+	my $cwd = getcwd();
+
+	system($0, 'install.pl', "$cwd/tmp_install");
+	my $status = $? >> 8;
+	exit $status if $status;
+
+	$ENV{PATH} = "$cwd/tmp_install/bin;$cwd/tmp_install/lib;$ENV{PATH}";
+
 	my @args = (
 		"../../../$Config/pg_regress/pg_regress",
 		"--dlpath=.",
-		"--psqldir=../../../$Config/psql",
+		"--bindir=",
 		"--schedule=${schedule}_schedule",
 		"--encoding=SQL_ASCII",
 		"--no-locale",
-		"--temp-install=./tmp_check",
-		"--top-builddir=\"$topdir\"");
+		"--temp-instance=./tmp_check");
 	push(@args, $maxconn)     if $maxconn;
 	push(@args, $temp_config) if $temp_config;
 	system(@args);
-	my $status = $? >> 8;
+	$status = $? >> 8;
 	exit $status if $status;
 }
 
 sub ecpgcheck
 {
 	chdir $startdir;
+
 	system("msbuild ecpg_regression.proj /p:config=$Config");
 	my $status = $? >> 8;
 	exit $status if $status;
+
+	my $cwd = getcwd();
+
+	system($0, 'install.pl', "$cwd/tmp_install");
+	$status = $? >> 8;
+	exit $status if $status;
+
+	$ENV{PATH} = "$cwd/tmp_install/bin;$cwd/tmp_install/lib;$ENV{PATH}";
+
 	chdir "$topdir/src/interfaces/ecpg/test";
 	$schedule = "ecpg";
 	my @args = (
 		"../../../../$Config/pg_regress_ecpg/pg_regress_ecpg",
-		"--psqldir=../../../$Config/psql",
+		"--bindir=",
 		"--dbname=regress1,connectdb",
 		"--create-role=connectuser,connectdb",
 		"--schedule=${schedule}_schedule",
 		"--encoding=SQL_ASCII",
 		"--no-locale",
-		"--temp-install=./tmp_chk",
+		"--temp-instance=./tmp_chk",
 		"--top-builddir=\"$topdir\"");
 	push(@args, $maxconn) if $maxconn;
 	system(@args);
@@ -153,7 +170,7 @@ sub isolationcheck
 		"../../../$Config/pg_isolation_regress");
 	my @args = (
 		"../../../$Config/pg_isolation_regress/pg_isolation_regress",
-		"--psqldir=../../../$Config/psql",
+		"--bindir=../../../$Config/psql",
 		"--inputdir=.",
 		"--schedule=./isolation_schedule");
 	push(@args, $maxconn) if $maxconn;
@@ -202,7 +219,7 @@ sub plcheck
 		print "Checking $lang\n";
 		my @args = (
 			"../../../$Config/pg_regress/pg_regress",
-			"--psqldir=../../../$Config/psql",
+			"--bindir=../../../$Config/psql",
 			"--dbname=pl_regression", @lang_args, @tests);
 		system(@args);
 		my $status = $? >> 8;
@@ -237,7 +254,7 @@ sub contribcheck
 		my @opts  = fetchRegressOpts();
 		my @args  = (
 			"../../$Config/pg_regress/pg_regress",
-			"--psqldir=../../$Config/psql",
+			"--bindir=../../$Config/psql",
 			"--dbname=contrib_regression", @opts, @tests);
 		system(@args);
 		my $status = $? >> 8;
-- 
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