[PATCH v5 07/18] test_cmp: do not use "diff -u" on platforms that lack one

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gary V. Vaughan
Date: Friday, May 14, 2010 - 2:31 am

By default the testsuite calls 'diff -u' whenever a file comparison is
called for.  Unfortunately that throws a "diff: unknown option '-u'"
error for most non-GNU diffs.

This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where
that happens.  The previous version of this patch forgot to export
GIT_TEST_CMP from t/Makefile, which is why 'make test' continued to
fail most tests on most architectures - test-lib.sh was falling back
on its default of `diff -u' for GIT_TEST_CMP.  This version of this
patch shows a vast improvement in testsuite results where either GNU
diff is in the path at configure time, or where Makefile knows that
GIT_TEST_CMP=cmp is required.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
---
 Makefile   |    5 +++++
 t/Makefile |    1 +
 2 files changed, 6 insertions(+)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -815,18 +815,21 @@ ifeq ($(uname_S),SunOS)
 		NO_STRLCPY = YesPlease
 		NO_C99_FORMAT = YesPlease
 		NO_STRTOUMAX = YesPlease
+		GIT_TEST_CMP = cmp
 	endif
 	ifeq ($(uname_R),5.8)
 		NO_UNSETENV = YesPlease
 		NO_SETENV = YesPlease
 		NO_C99_FORMAT = YesPlease
 		NO_STRTOUMAX = YesPlease
+		GIT_TEST_CMP = cmp
 	endif
 	ifeq ($(uname_R),5.9)
 		NO_UNSETENV = YesPlease
 		NO_SETENV = YesPlease
 		NO_C99_FORMAT = YesPlease
 		NO_STRTOUMAX = YesPlease
+		GIT_TEST_CMP = cmp
 	endif
 	INSTALL = /usr/ucb/install
 	TAR = gtar
@@ -903,6 +906,7 @@ ifeq ($(uname_S),AIX)
 	else
 		PTHREAD_LIBS = -lpthread
 	endif
+	GIT_TEST_CMP = cmp
 endif
 ifeq ($(uname_S),GNU)
 	# GNU/Hurd
@@ -957,6 +961,7 @@ ifeq ($(uname_S),HP-UX)
 	NO_HSTRERROR = YesPlease
 	NO_SYS_SELECT_H = YesPlease
 	SNPRINTF_RETURNS_BOGUS = YesPlease
+	GIT_TEST_CMP = cmp
 endif
 ifeq ($(uname_S),Windows)
 	GIT_VERSION := $(GIT_VERSION).MSVC
Index: b/t/Makefile
===================================================================
--- a/t/Makefile
+++ b/t/Makefile
@@ -3,6 +3,7 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
+-include ../config.mak.autogen
 -include ../config.mak
 
 #GIT_TEST_OPTS=--verbose --debug

-- 
Gary V. Vaughan (gary@thewrittenword.com)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v5 00/18] Portability patches for git-1.7.1, Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 04/18] enums: omit trailing comma for portability, Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 07/18] test_cmp: do not use "diff -u" on platfor ..., Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 11/18] Some platforms lack socklen_t type, Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 12/18] Allow disabling &quot;inline&quot;, Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 13/18] inline declaration does not work on AIX, Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 14/18] Makefile: SunOS 5.6 portability fix, Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 16/18] Makefile: HPUX11 portability fixes., Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 17/18] Makefile: HP-UX 10.20 portability fixes., Gary V. Vaughan, (Fri May 14, 2:31 am)
[PATCH v5 18/18] Makefile: Tru64 portability fix, Gary V. Vaughan, (Fri May 14, 2:31 am)
Re: [PATCH v5 00/18] Portability patches for git-1.7.1, Gary V. Vaughan, (Tue May 25, 10:56 pm)
Re: [PATCH v5 00/18] Portability patches for git-1.7.1, Gary V. Vaughan, (Mon Jun 7, 8:45 am)
Re: [PATCH v5 00/18] Portability patches for git-1.7.1, Junio C Hamano, (Mon Jun 7, 11:07 am)
Re: [PATCH v5 00/18] Portability patches for git-1.7.1, Junio C Hamano, (Thu Jun 10, 9:30 pm)