]> granicus.if.org Git - postgresql/commitdiff
Use diff's -w switch only on Windows, to avoid problems with inconsistent
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Nov 2009 16:02:24 +0000 (16:02 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Nov 2009 16:02:24 +0000 (16:02 +0000)
newline representations.  Per buildfarm results and subsequent discussion.
Sync up a couple of other places that had their own policies.

src/interfaces/ecpg/test/pg_regress_ecpg.c
src/test/mb/mbregress.sh
src/test/regress/pg_regress.c

index 4681d8c771b29a97c11a135142a06b1fc5fc94fb..e04e9038f386210cbbe68f1af63c184efa5f1d09 100644 (file)
@@ -11,7 +11,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress_ecpg.c,v 1.5 2009/01/01 17:24:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress_ecpg.c,v 1.6 2009/11/23 16:02:24 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -161,15 +161,7 @@ ecpg_start_test(const char *testname,
 static void
 ecpg_init(void)
 {
-       /* no reason to set -w for ecpg checks, except for when on windows */
-       if (strstr(host_platform, "-win32") || strstr(host_platform, "-mingw32"))
-               basic_diff_opts = "-w";
-       else
-               basic_diff_opts = "";
-       if (strstr(host_platform, "-win32") || strstr(host_platform, "-mingw32"))
-               pretty_diff_opts = "-C3 -w";
-       else
-               pretty_diff_opts = "-C3";
+       /* nothing to do here at the moment */
 }
 
 int
index 8a2aca6267bd0368b4a1b59470645d615b641aa6..7a6e1e281c42146593c721dafc6333ac9219f03e 100644 (file)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $PostgreSQL: pgsql/src/test/mb/mbregress.sh,v 1.10 2009/05/06 16:15:21 tgl Exp $
+# $PostgreSQL: pgsql/src/test/mb/mbregress.sh,v 1.11 2009/11/23 16:02:24 tgl Exp $
 
 if echo '\c' | grep -s c >/dev/null 2>&1
 then
@@ -49,7 +49,7 @@ do
   
        if [ `diff ${EXPECTED} results/${i}.out | wc -l` -ne 0 ]
        then
-               ( diff -wC3 ${EXPECTED} results/${i}.out; \
+               ( diff -C3 ${EXPECTED} results/${i}.out; \
                echo "";  \
                echo "----------------------"; \
                echo "" ) >> regression.diffs
index c6bfbdce16427c359bdf075a99f390c679da3d9b..7fe472b50378a9a9763dadd688ea8b682c0a777f 100644 (file)
@@ -11,7 +11,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.66 2009/11/22 17:54:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.67 2009/11/23 16:02:24 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -65,9 +65,18 @@ static char *makeprog = MAKEPROG;
 static char *shellprog = SHELLPROG;
 #endif
 
-/* currently we can use the same diff switches on all platforms */
+/*
+ * On Windows we use -w in diff switches to avoid problems with inconsistent
+ * newline representation.  The actual result files will generally have
+ * Windows-style newlines, but the comparison files might or might not.
+ */
+#ifndef WIN32
 const char *basic_diff_opts = "";
 const char *pretty_diff_opts = "-C3";
+#else
+const char *basic_diff_opts = "-w";
+const char *pretty_diff_opts = "-w -C3";
+#endif
 
 /* options settable from command line */
 _stringlist *dblist = NULL;