Skip to content

Commit 8d97c1d

Browse files
committed
Use diff's -w switch only on Windows, to avoid problems with inconsistent
newline representations. Per buildfarm results and subsequent discussion. Sync up a couple of other places that had their own policies.
1 parent fe4b8c4 commit 8d97c1d

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

src/interfaces/ecpg/test/pg_regress_ecpg.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress_ecpg.c,v 1.5 2009/01/01 17:24:02 momjian Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress_ecpg.c,v 1.6 2009/11/23 16:02:24 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -161,15 +161,7 @@ ecpg_start_test(const char *testname,
161161
static void
162162
ecpg_init(void)
163163
{
164-
/* no reason to set -w for ecpg checks, except for when on windows */
165-
if (strstr(host_platform, "-win32") || strstr(host_platform, "-mingw32"))
166-
basic_diff_opts = "-w";
167-
else
168-
basic_diff_opts = "";
169-
if (strstr(host_platform, "-win32") || strstr(host_platform, "-mingw32"))
170-
pretty_diff_opts = "-C3 -w";
171-
else
172-
pretty_diff_opts = "-C3";
164+
/* nothing to do here at the moment */
173165
}
174166

175167
int

src/test/mb/mbregress.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# $PostgreSQL: pgsql/src/test/mb/mbregress.sh,v 1.10 2009/05/06 16:15:21 tgl Exp $
2+
# $PostgreSQL: pgsql/src/test/mb/mbregress.sh,v 1.11 2009/11/23 16:02:24 tgl Exp $
33

44
if echo '\c' | grep -s c >/dev/null 2>&1
55
then
@@ -49,7 +49,7 @@ do
4949

5050
if [ `diff ${EXPECTED} results/${i}.out | wc -l` -ne 0 ]
5151
then
52-
( diff -wC3 ${EXPECTED} results/${i}.out; \
52+
( diff -C3 ${EXPECTED} results/${i}.out; \
5353
echo ""; \
5454
echo "----------------------"; \
5555
echo "" ) >> regression.diffs

src/test/regress/pg_regress.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2009, 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.66 2009/11/22 17:54:23 tgl Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.67 2009/11/23 16:02:24 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -65,9 +65,18 @@ static char *makeprog = MAKEPROG;
6565
static char *shellprog = SHELLPROG;
6666
#endif
6767

68-
/* currently we can use the same diff switches on all platforms */
68+
/*
69+
* On Windows we use -w in diff switches to avoid problems with inconsistent
70+
* newline representation. The actual result files will generally have
71+
* Windows-style newlines, but the comparison files might or might not.
72+
*/
73+
#ifndef WIN32
6974
const char *basic_diff_opts = "";
7075
const char *pretty_diff_opts = "-C3";
76+
#else
77+
const char *basic_diff_opts = "-w";
78+
const char *pretty_diff_opts = "-w -C3";
79+
#endif
7180

7281
/* options settable from command line */
7382
_stringlist *dblist = NULL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy