diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-04-12 15:57:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-13 15:52:47 -0700 |
commit | 127df8c6cfd42ea666df9221d208b33b712d9994 (patch) | |
tree | d88d91a86a591f4ac129a5d5b0552a30e8baccdb /t/test-lib.sh | |
parent | c36f94123bb16d412fc0f7c49d655bfe4259c4b6 (diff) | |
download | git-127df8c6cfd42ea666df9221d208b33b712d9994.tar.gz |
i18n: do not overuse C_LOCALE_OUTPUT (grep)
Instead of skipping the whole test, introduce test_i18ngrep wrapper that
pretends a successful result under GETTEXT_POISON build.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index 3e7c2bb726..763b9c55a8 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1085,6 +1085,24 @@ test_i18ncmp () { test -n "$GETTEXT_POISON" || test_cmp "$@" } +# Use this instead of "grep expected-string actual" to see if the +# output from a git command that can be translated either contains an +# expected string, or does not contain an unwanted one. When running +# under GETTEXT_POISON this pretends that the command produced expected +# results. +test_i18ngrep () { + if test -n "$GETTEXT_POISON" + then + : # pretend success + elif test "x!" = "x$1" + then + shift + ! grep "$@" + else + grep "$@" + fi +} + # test whether the filesystem supports symbolic links ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS rm -f y |