mingw: fix perl related test failures
cover mingw: fix perl related test failures
For performance reasons (and also because we retired support for git svn in Git for Windows), Perl-related tests are skipped from the CI builds. As can be expected, this caused some bit-rot.
While this is not exactly -rc1 material, in preparing for Git for Windows v2.56.0-rc0 I did run the entire test suite on Windows/ARM64 and these were the only two bugs that needed fixing.
Johannes Schindelin (2):
t9700: accommodate for MSYS2 Perl reporting as cygwin
t9129: skip UTF-8 tests on Windows
t/t9129-git-svn-i18n-commitencoding.sh | 4 ++-- t/t9700/test.pl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
base-commit: b8242b093d9e941a34460d715e3ce616a34ac3fe
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2227%2Fdscho%2Ffix-perl-related-test-failures-on-windows-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2227/dscho/fix-perl-related-test-failures-on-windows-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2227
Signature · 1 line
gitgitgadget
PATCH 1/2 t9700: accommodate for MSYS2 Perl reporting as `cygwin`
From: Johannes Schindelin <[email protected]>
As of a year or two ago, there is this push to align MSYS2 more closely with Cygwin, so as to benefit from a closer collaboration. Part of that is that the triplet x86_64-pc-cygwin is used nowadays, whereas it had been x86_64-pc-msys previously. Likewise, Perl now reports $^O as cygwin instead of msys.
The Perl module test used msys as tell-tale when to accommodate for a native Windows version of git.exe which would report absolute _Windows_ paths rather than those pseudo-Unix paths. We cannot use that tell-tale anymore, and we also cannot adjust it to cygwin because that would break in Cygwin (where git.exe reports absolute pseudo-Unix paths).
Let's use the environment variable MSYSTEM instead (being mindful that the MSYSTEM=MSYS variant would _also_ reflect a setup where git.exe won't report absolute _Windows_ paths).
--- t/t9700/test.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t9700/test.pl +1 -1
@@ -118,7 +118,7 @@ unlink $tmpfile; # paths my $abs_git_dir = $abs_repo_dir . "/.git"; -if ($^O eq 'msys') { +if (defined $ENV{MSYSTEM} && $ENV{MSYSTEM} ne 'MSYS') { $abs_git_dir = `cygpath -am "$abs_repo_dir/.git"`; $abs_git_dir =~ s/\r?\n?$//; }
Signature · 1 line
gitgitgadget
PATCH 2/2 t9129: skip UTF-8 tests on Windows
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
The assumption of this test is that Perl and Git have the same idea how to perform encoding conversions.
However, in Git for Windows, Git is a native Win32 program, and such programs have a very different concept of encodings (called "Code Pages", and they are not controlled via environment variables at all), whereas the Perl interpreter used in Git for Windows is a pseudo-Unix one that uses the MSYS2 runtime (which _does_ try very much to abide by Unix' LC_ALL and friends, and totally ignores Windows' current or active code pages).
As such, these test cases _cannot_ work with Git for Windows. So let's just skip them on that platform.
--- t/t9129-git-svn-i18n-commitencoding.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
t/t9129-git-svn-i18n-commitencoding.sh +2 -2
@@ -71,7 +71,7 @@ do ' done -test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' ' +test_expect_success UTF8,!MINGW 'ISO-8859-1 should match UTF-8 in svn' ' ( cd ISO8859-1 && compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
@@ -80,7 +80,7 @@ test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' ' for H in eucJP ISO-2022-JP do - test_expect_success UTF8 "$H should match UTF-8 in svn" ' + test_expect_success UTF8,!MINGW "$H should match UTF-8 in svn" ' ( cd $H && compare_svn_head_with "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
Signature · 1 line
gitgitgadget