test-lib.sh - define and use GREP_STRIPS_CR

Define a common macro for grep needing -U to allow tests to not need to inquire of specific platforms needing this option. Change t3032 and t5560 to use this rather than testing explicitly for mingw. This fixes these two tests on Cygwin. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mark Levedahl committed Jul 18, 2013 at 17:44 UTC 97669eed109f5dea7dffe771d8f6aba4acf84b27
3 files changed +4 -2
t/t3032-merge-recursive-options.sh
+1 -1
@@ -14,7 +14,7 @@ test_description='merge-recursive options
14 . ./test-lib.sh
15
16 test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
17 -test_have_prereq MINGW && export GREP_OPTIONS=-U
17 +test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U
18
19 test_expect_success 'setup' '
20 conflict_hunks () {
t/t5560-http-backend-noserver.sh
+1 -1
@@ -5,7 +5,7 @@ test_description='test git-http-backend-noserver'
5
6 HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
7
8 -test_have_prereq MINGW && export GREP_OPTIONS=-U
8 +test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U
9
10 run_backend() {
11 echo "$2" |
t/test-lib.sh
+2
@@ -668,6 +668,7 @@ case $(uname -s) in
668 test_set_prereq MINGW
669 test_set_prereq NOT_CYGWIN
670 test_set_prereq SED_STRIPS_CR
671 + test_set_prereq GREP_STRIPS_CR
672 ;;
673 *CYGWIN*)
674 test_set_prereq POSIXPERM
@@ -675,6 +676,7 @@ case $(uname -s) in
676 test_set_prereq NOT_MINGW
677 test_set_prereq CYGWIN
678 test_set_prereq SED_STRIPS_CR
679 + test_set_prereq GREP_STRIPS_CR
680 ;;
681 *)
682 test_set_prereq POSIXPERM