summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c36f941)
raw | patch | inline | side by side (parent: c36f941)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 12 Apr 2011 22:57:08 +0000 (15:57 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 13 Apr 2011 22:52:47 +0000 (15:52 -0700) |
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>
pretends a successful result under GETTEXT_POISON build.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0001-init.sh | patch | blob | history | |
t/test-lib.sh | patch | blob | history |
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index a5816d0e4f3744f8ba30666d8bb5828abf6cda51..651e0982cf11380842d401c6b65e98a1e193f669 100755 (executable)
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
fi
'
-test_expect_success C_LOCALE_OUTPUT 'reinit' '
+test_expect_success 'reinit' '
(
sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
git init >out1 2>err1 &&
git init >out2 2>err2
) &&
- grep "Initialized empty" again/out1 &&
- grep "Reinitialized existing" again/out2 &&
+ test_i18ngrep "Initialized empty" again/out1 &&
+ test_i18ngrep "Reinitialized existing" again/out2 &&
>again/empty &&
- test_cmp again/empty again/err1 &&
- test_cmp again/empty again/err2
+ test_i18ncmp again/empty again/err1 &&
+ test_i18ncmp again/empty again/err2
'
test_expect_success 'init with --template' '
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3e7c2bb7265abe5f29ae4ab9fcd56571e4f635b1..763b9c55a81796e11fcc3eaefd9ec362106c7c2a 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
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