>From d953d4038dc3de467cef025a45a226a950f45825 Mon Sep 17 00:00:00 2001
From: Craig Ringer <craig@2ndquadrant.com>
Date: Mon, 10 Feb 2014 09:22:27 +0800
Subject: [PATCH 2/2] Make vcregress.pl bail out informatively when there's
 nothing to test

---
 src/tools/msvc/vcregress.pl | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 447b4a1..f8fe152 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -2,7 +2,14 @@
 
 # src/tools/msvc/vcregress.pl
 
+BEGIN {
+	chdir "../../.." if (-d "../../../src/tools/msvc");
+	push(@INC, "src/tools/msvc");
+}
+
 use strict;
+use warnings;
+use 5.10.1;
 
 our $config;
 
@@ -11,9 +18,9 @@ use File::Copy;
 
 use Install qw(Install);
 
+
 my $startdir = getcwd();
 
-chdir "../../.." if (-d "../../../src/tools/msvc");
 
 my $topdir = getcwd();
 
@@ -42,7 +49,16 @@ else
 }
 
 # use a capital C here because config.pl has $config
-my $Config = -e "release/postgres/postgres.exe" ? "Release" : "Debug";
+my $Config;
+if (-e "Release/postgres/postgres.exe") {
+	$Config = "Release";
+	print("Testing RELEASE build\n");
+} elsif (-e "Debug/postgres/postgres.exe") {
+	$Config = "Debug";
+	print("Testing DEBUG build\n");
+} else {
+	die("No postgres/postgres.exe found in Release or Debug dirs");
+}
 
 copy("$Config/refint/refint.dll",                 "src/test/regress");
 copy("$Config/autoinc/autoinc.dll",               "src/test/regress");
-- 
1.8.3.1

