Improve msys2 detection for TAP tests
authorAndrew Dunstan
Thu, 27 Jan 2022 13:17:42 +0000 (08:17 -0500)
committerAndrew Dunstan
Thu, 27 Jan 2022 13:26:28 +0000 (08:26 -0500)
Perl instances on some msys toolchains (e.g. UCRT64) have their
configured osname set to 'MSWin32' rather than 'msys'.  The test for
the msys2 platform is adjusted accordingly.

Backpatch to release 14.

src/test/perl/TestLib.pm

index e4c2a95ec773c179fe63af24abd00799689d30b0..e4dda0db9dc89225ae95f9cce75573030581abc3 100644 (file)
@@ -143,7 +143,8 @@ BEGIN
    # Must be set early
    $windows_os = $Config{osname} eq 'MSWin32' || $Config{osname} eq 'msys';
    # Check if this environment is MSYS2.
-   $is_msys2 = $^O eq 'msys' && `uname -or` =~ /^[2-9].*Msys/;
+   $is_msys2 = $windows_os && -x '/usr/bin/uname'  &&
+     `uname -or` =~ /^[2-9].*Msys/;
 
    if ($windows_os)
    {