Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7da24bc

Browse files
committed
Print out diff status code when we think there's a hard failure.
May help in debugging behavior on Windows.
1 parent c310437 commit 7da24bc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test/regress/pg_regress.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.8 2006/07/20 02:15:17 tgl Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.9 2006/07/20 03:30:58 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -203,6 +203,10 @@ stop_postmaster(void)
203203
/* We use pg_ctl to issue the kill and wait for stop */
204204
char buf[MAXPGPATH * 2];
205205

206+
/* On Windows, system() seems not to force fflush, so... */
207+
fflush(stdout);
208+
fflush(stderr);
209+
206210
snprintf(buf, sizeof(buf),
207211
SYSTEMQUOTE "\"%s/pg_ctl\" stop -D \"%s/data\" -s -m fast" SYSTEMQUOTE,
208212
bindir, temp_install);
@@ -843,7 +847,7 @@ results_differ(const char *testname)
843847
r = system(cmd);
844848
if (!WIFEXITED(r) || WEXITSTATUS(r) > 1)
845849
{
846-
fprintf(stderr, _("diff command failed: %s\n"), cmd);
850+
fprintf(stderr, _("diff command failed with status %d: %s\n"), r, cmd);
847851
exit_nicely(2);
848852
}
849853

@@ -872,7 +876,8 @@ results_differ(const char *testname)
872876
r = system(cmd);
873877
if (!WIFEXITED(r) || WEXITSTATUS(r) > 1)
874878
{
875-
fprintf(stderr, _("diff command failed: %s\n"), cmd);
879+
fprintf(stderr, _("diff command failed with status %d: %s\n"),
880+
r, cmd);
876881
exit_nicely(2);
877882
}
878883

@@ -902,7 +907,7 @@ results_differ(const char *testname)
902907
r = system(cmd);
903908
if (!WIFEXITED(r) || WEXITSTATUS(r) > 1)
904909
{
905-
fprintf(stderr, _("diff command failed: %s\n"), cmd);
910+
fprintf(stderr, _("diff command failed with status %d: %s\n"), r, cmd);
906911
exit_nicely(2);
907912
}
908913

0 commit comments

Comments
 (0)