From 774223165c9ecf743ce3d86d4bc3b6cad2335221 Mon Sep 17 00:00:00 2001 From: Artem Pianykh Date: Tue, 14 Jan 2020 02:14:44 -0800 Subject: [PATCH] [tests] Use git diff instead of diff to colorize `make test` output Summary: `diff` by default doesn't colorize its output, while `git diff` does. Since we already depend on git it seems like a safe change and brings some quality of life improvement while working with tests. Reviewed By: ngorogiannis Differential Revision: D19374691 fbshipit-source-id: 8872b527c --- infer/tests/base.make | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infer/tests/base.make b/infer/tests/base.make index 52cb484ce..bfa00bffb 100644 --- a/infer/tests/base.make +++ b/infer/tests/base.make @@ -25,7 +25,8 @@ define check_no_duplicates endef define check_no_diff - diff -u $(1) $(2) >&2 || \ + git --no-pager diff --color=auto --no-ext-diff --no-index --word-diff --unified=1 --minimal \ + $$(realpath $(1)) $$(realpath $(2)) >&2 || \ (printf '\n' >&2; \ printf '$(TERM_ERROR)Test output ($(2)) differs from expected test output $(1)$(TERM_RESET)\n' >&2; \ printf '$(TERM_ERROR)Run the following command to replace the expected test output with the new output:$(TERM_RESET)\n' >&2; \