All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Lars Schneider" <larsxschneider@gmail.com>,
	"Ann T Ropea" <bedhanger@gmx.de>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/2] tests: fix non-portable iconv invocation
Date: Tue, 28 Aug 2018 19:38:27 +0000	[thread overview]
Message-ID: <20180828193827.8648-3-avarab@gmail.com> (raw)
In-Reply-To: <20180828193827.8648-1-avarab@gmail.com>

The iconv that comes with a FreeBSD 11.2-RELEASE-p2 box I have access
to doesn't support the SHIFT-JIS encoding. Guard a test added in
e92d62253 ("convert: add round trip check based on
'core.checkRoundtripEncoding'", 2018-04-15) first released with Git
v2.18.0 with a prerequisite that checks for its availability.

The iconv command is in POSIX, and we have numerous tests
unconditionally relying on its ability to convert ASCII, UTF-8 and
UTF-16, but unconditionally relying on the presence of more obscure
encodings isn't portable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t0028-working-tree-encoding.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index 12b8eb963a..b0f4490e8e 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -203,7 +203,11 @@ test_expect_success 'error if encoding garbage is already in Git' '
 	test_i18ngrep "error: BOM is required" err.out
 '
 
-test_expect_success 'check roundtrip encoding' '
+test_lazy_prereq ICONV_SHIFT_JIS '
+	iconv -f UTF-8 -t SHIFT-JIS </dev/null 2>/dev/null
+'
+
+test_expect_success ICONV_SHIFT_JIS 'check roundtrip encoding' '
 	test_when_finished "rm -f roundtrip.shift roundtrip.utf16" &&
 	test_when_finished "git reset --hard HEAD" &&
 
-- 
2.19.0.rc0.228.g281dcd1b4d0


  parent reply	other threads:[~2018-08-28 19:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 19:38 [PATCH 0/2] FreeBSD & AIX test portability fixes Ævar Arnfjörð Bjarmason
2018-08-28 19:38 ` [PATCH 1/2] tests: fix non-portable "${var:-"str"}" construct Ævar Arnfjörð Bjarmason
2018-08-28 19:48   ` Junio C Hamano
2018-08-29 20:09   ` Ann T Ropea
2018-08-28 19:38 ` Ævar Arnfjörð Bjarmason [this message]
2018-08-28 22:55   ` [PATCH 2/2] tests: fix non-portable iconv invocation Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180828193827.8648-3-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=bedhanger@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.