Skip to content

Commit b2b0026

Browse files
Gary V. Vaughangitster
authored andcommitted
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>
1 parent 7b3bdbb commit b2b0026

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,18 +815,21 @@ ifeq ($(uname_S),SunOS)
815815
NO_STRLCPY = YesPlease
816816
NO_C99_FORMAT = YesPlease
817817
NO_STRTOUMAX = YesPlease
818+
GIT_TEST_CMP = cmp
818819
endif
819820
ifeq ($(uname_R),5.8)
820821
NO_UNSETENV = YesPlease
821822
NO_SETENV = YesPlease
822823
NO_C99_FORMAT = YesPlease
823824
NO_STRTOUMAX = YesPlease
825+
GIT_TEST_CMP = cmp
824826
endif
825827
ifeq ($(uname_R),5.9)
826828
NO_UNSETENV = YesPlease
827829
NO_SETENV = YesPlease
828830
NO_C99_FORMAT = YesPlease
829831
NO_STRTOUMAX = YesPlease
832+
GIT_TEST_CMP = cmp
830833
endif
831834
INSTALL = /usr/ucb/install
832835
TAR = gtar
@@ -903,6 +906,7 @@ ifeq ($(uname_S),AIX)
903906
else
904907
PTHREAD_LIBS = -lpthread
905908
endif
909+
GIT_TEST_CMP = cmp
906910
endif
907911
ifeq ($(uname_S),GNU)
908912
# GNU/Hurd
@@ -957,6 +961,7 @@ ifeq ($(uname_S),HP-UX)
957961
NO_HSTRERROR = YesPlease
958962
NO_SYS_SELECT_H = YesPlease
959963
SNPRINTF_RETURNS_BOGUS = YesPlease
964+
GIT_TEST_CMP = cmp
960965
endif
961966
ifeq ($(uname_S),Windows)
962967
GIT_VERSION := $(GIT_VERSION).MSVC

t/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Copyright (c) 2005 Junio C Hamano
44
#
55

6+
-include ../config.mak.autogen
67
-include ../config.mak
78

89
#GIT_TEST_OPTS=--verbose --debug

0 commit comments

Comments
 (0)