[svn:DBD-Pg] r11562 - DBD-Pg/trunk/t

[email protected]
Newsgroups perl.dbd.pg.changes
Message-ID <[email protected]>
Author: turnstep
Date: Tue Jul 22 10:23:41 2008
New Revision: 11562

Modified:
   DBD-Pg/trunk/t/01connect.t
   DBD-Pg/trunk/t/dbdpg_test_setup.pl

Log:
Minor error reporting improvements.


Modified: DBD-Pg/trunk/t/01connect.t
==============================================================================
--- DBD-Pg/trunk/t/01connect.t	(original)
+++ DBD-Pg/trunk/t/01connect.t	Tue Jul 22 10:23:41 2008
@@ -139,7 +139,7 @@
 	}
 
 	if (defined $connerror and length $connerror) {
-		$connerror =~ s/.+?failed: //;
+		$connerror =~ s/.+?failed: ([^\n]+).*/$1/s;
 		$connerror =~ s{\n at t/dbdpg.*}{}m;
 		if ($connerror =~ /create semaphores/) {
 			$connerror =~ s/.*(FATAL.*?)HINT.*/$1/sm;

Modified: DBD-Pg/trunk/t/dbdpg_test_setup.pl
==============================================================================
--- DBD-Pg/trunk/t/dbdpg_test_setup.pl	(original)
+++ DBD-Pg/trunk/t/dbdpg_test_setup.pl	Tue Jul 22 10:23:41 2008
@@ -585,9 +585,13 @@
 	}
 	my ($testdsn, $testuser, $testdir, $error) = ('','','','?');
 	my ($helpconnect, $su, $uid, $initdb) = (0,'','','default');
+	my $inerror = 0;
 	if (-e $helpfile) {
 		open $fh, '<', $helpfile or die qq{Could not open "$helpfile": $!\n};
 		while (<$fh>) {
+			if ($inerror) {
+				$error .= "\n$_";
+			}
 			/DSN: (.+)/           and $testdsn = $1;
 			/User: (\w+)/         and $testuser = $1;
 			/Helpconnect: (\d+)/  and $helpconnect = $1;
@@ -596,7 +600,7 @@
 			/Testdir: (.+)/       and $testdir = $1;
 			/pg_ctl: (.+)/        and $pg_ctl = $1;
 			/initdb: (.+)/        and $initdb = $1;
-			/ERROR: (.+)/         and $error = $1;
+			/ERROR: (.+)/         and $error = $1 and $inerror = 1;
 		}
 		close $fh or die qq{Could not close "$helpfile": $!\n};
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.