@matheusbsbs / matheus-bagliano / commits / b2b0026eed
Fork 0

test_cmp: do not use "diff -u" on platforms that lack one

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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Gary V. Vaughan committed May 14, 2010 at 09:31 UTC b2b0026eede10894d3317920a277b2a579cd86c5
2 files changed +6
Makefile
+5
@@ -815,18 +815,21 @@ ifeq ($(uname_S),SunOS)
815 NO_STRLCPY = YesPlease
816 NO_C99_FORMAT = YesPlease
817 NO_STRTOUMAX = YesPlease
818 + GIT_TEST_CMP = cmp
819 endif
820 ifeq ($(uname_R),5.8)
821 NO_UNSETENV = YesPlease
822 NO_SETENV = YesPlease
823 NO_C99_FORMAT = YesPlease
824 NO_STRTOUMAX = YesPlease
825 + GIT_TEST_CMP = cmp
826 endif
827 ifeq ($(uname_R),5.9)
828 NO_UNSETENV = YesPlease
829 NO_SETENV = YesPlease
830 NO_C99_FORMAT = YesPlease
831 NO_STRTOUMAX = YesPlease
832 + GIT_TEST_CMP = cmp
833 endif
834 INSTALL = /usr/ucb/install
835 TAR = gtar
@@ -903,6 +906,7 @@ ifeq ($(uname_S),AIX)
906 else
907 PTHREAD_LIBS = -lpthread
908 endif
909 + GIT_TEST_CMP = cmp
910 endif
911 ifeq ($(uname_S),GNU)
912 # GNU/Hurd
@@ -957,6 +961,7 @@ ifeq ($(uname_S),HP-UX)
961 NO_HSTRERROR = YesPlease
962 NO_SYS_SELECT_H = YesPlease
963 SNPRINTF_RETURNS_BOGUS = YesPlease
964 + GIT_TEST_CMP = cmp
965 endif
966 ifeq ($(uname_S),Windows)
967 GIT_VERSION := $(GIT_VERSION).MSVC
t/Makefile
+1
@@ -3,6 +3,7 @@
3 # Copyright (c) 2005 Junio C Hamano
4 #
5
6 +-include ../config.mak.autogen
7 -include ../config.mak
8
9 #GIT_TEST_OPTS=--verbose --debug