aboutsummaryrefslogtreecommitdiffstats
path: root/t/t4041-diff-submodule-option.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-10-16 10:12:53 +0200
committerTaylor Blau <me@ttaylorr.com>2024-10-16 17:00:49 -0400
commitdf383b584267d3b7b57fb513bef4a2ff8eb8fe30 (patch)
treef2ffe2b4c22060ad1042537c687c9e3984e06a84 /t/t4041-diff-submodule-option.sh
parented7634ebcc0cbfb229bc0bf2c74cd3ef4060c096 (diff)
downloadgit-df383b584267d3b7b57fb513bef4a2ff8eb8fe30.tar.gz
t/test-lib: wire up NO_ICONV prerequisite
The iconv library is used by Git to reencode files, commit messages and other things. As such it is a rather integral part, but given that many platforms nowadays use UTF-8 everywhere you can live without support for reencoding in many situations. It is thus optional to build Git with iconv, and some of our platforms wired up in "config.mak.uname" disable it. But while we support building without it, running our test suite with "NO_ICONV=Yes" causes many test failures. Wire up a new test prerequisite ICONV that gets populated via our GIT-BUILD-OPTIONS. Annotate failing tests accordingly. Note that this commit does not do a deep dive into every single test to assess whether the failure is expected or not. Most of the tests do smell like the expected kind of failure though. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 't/t4041-diff-submodule-option.sh')
-rwxr-xr-xt/t4041-diff-submodule-option.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index 8fc40e75eb..aa149e0085 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -15,12 +15,18 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
-# Tested non-UTF-8 encoding
-test_encoding="ISO8859-1"
+# Test non-UTF-8 encoding in case iconv is available.
+if test_have_prereq ICONV
+then
+ test_encoding="ISO8859-1"
+ # String "added" in German (translated with Google Translate), encoded in UTF-8,
+ # used in sample commit log messages in add_file() function below.
+ added=$(printf "hinzugef\303\274gt")
+else
+ test_encoding="UTF-8"
+ added="added"
+fi
-# String "added" in German (translated with Google Translate), encoded in UTF-8,
-# used in sample commit log messages in add_file() function below.
-added=$(printf "hinzugef\303\274gt")
add_file () {
(
cd "$1" &&