From 4fdf71be1ca3a817851a14f91b75e7d30f885a48 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:37 +0000 Subject: tests: use "test_cmp", not "diff", when verifying the result In tests, call test_cmp rather than raw diff where possible (i.e. if the output does not go to a pipe), to allow the use of, say, 'cmp' when the default 'diff -u' is not compatible with a vendor diff. When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS. Signed-off-by: Gary V. Vaughan Signed-off-by: Junio C Hamano --- t/Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't/Makefile') diff --git a/t/Makefile b/t/Makefile index 25c559bb49..93a64750eb 100644 --- a/t/Makefile +++ b/t/Makefile @@ -6,10 +6,14 @@ -include ../config.mak #GIT_TEST_OPTS=--verbose --debug +GIT_TEST_CMP ?= $(DIFF) SHELL_PATH ?= $(SHELL) TAR ?= $(TAR) RM ?= rm -f +# Make sure test-lib.sh uses make's value of GIT_TEST_CMP +export GIT_TEST_CMP + # Shell quote; SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) -- cgit v1.2.3 From 7b3bdbb335b6be938b4748e86a41357e51c97804 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 31 May 2010 17:35:20 -0700 Subject: fixup: do not unconditionally disable "diff -u" Signed-off-by: Junio C Hamano --- t/Makefile | 4 ---- 1 file changed, 4 deletions(-) (limited to 't/Makefile') diff --git a/t/Makefile b/t/Makefile index 93a64750eb..25c559bb49 100644 --- a/t/Makefile +++ b/t/Makefile @@ -6,14 +6,10 @@ -include ../config.mak #GIT_TEST_OPTS=--verbose --debug -GIT_TEST_CMP ?= $(DIFF) SHELL_PATH ?= $(SHELL) TAR ?= $(TAR) RM ?= rm -f -# Make sure test-lib.sh uses make's value of GIT_TEST_CMP -export GIT_TEST_CMP - # Shell quote; SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) -- cgit v1.2.3 From b2b0026eede10894d3317920a277b2a579cd86c5 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Fri, 14 May 2010 09:31:38 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- t/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 't/Makefile') diff --git a/t/Makefile b/t/Makefile index 25c559bb49..1729485865 100644 --- 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 -- cgit v1.2.3