Skip to content

Commit 5057d66

Browse files
authored
This fixes broken tests due to msys2 changes. (#1892)
Due to changes in how msys2 perl reported the identity of the OS it was built for, our tests were failing to adapt to the Windows style file locations. Background: https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin Msys2 PR: msys2/MSYS2-packages#5177
1 parent 243e97e commit 5057d66

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/test-bcf-sr.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ sub parse_params
7171
error("Unknown parameter \"$arg\". Run -h for help.\n");
7272
}
7373
$$opts{tmp} = exists($$opts{keep_files}) ? $$opts{keep_files} : tempdir(CLEANUP=>1);
74-
if ($^O =~ /^msys/) {
74+
if ($^O =~ /^(cygwin|msys)/) {
7575
$$opts{tmp} = cygpath($$opts{tmp});
7676
}
7777
if ( $$opts{keep_files} ) { cmd("mkdir -p $$opts{keep_files}"); }

test/test.pl

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ sub cygpath {
104104
sub safe_tempdir
105105
{
106106
my $dir = tempdir(CLEANUP=>1);
107-
if ($^O =~ /^msys/) {
107+
if ($^O =~ /^(cygwin|msys)/) {
108108
$dir = cygpath($dir);
109109
}
110110
return $dir;
@@ -129,7 +129,7 @@ sub parse_params
129129
$$opts{path} = $FindBin::RealBin;
130130
$$opts{bin} = $FindBin::RealBin;
131131
$$opts{bin} =~ s{/test/?$}{};
132-
if ($^O =~ /^msys/) {
132+
if ($^O =~ /^(cygwin|msys)/) {
133133
$$opts{path} = cygpath($$opts{path});
134134
$$opts{bin} = cygpath($$opts{bin});
135135
}
@@ -1085,7 +1085,7 @@ sub test_index
10851085
# Tabix and custom index names
10861086
_cmd("$$opts{bin}/tabix -fp vcf $$opts{tmp}/index.vcf.gz");
10871087
my $wtmp = $$opts{tmp};
1088-
if ($^O =~ /^msys/) {
1088+
if ($^O =~ /^(cygwin|msys)/) {
10891089
$wtmp =~ s/\//\\\\/g;
10901090
}
10911091
test_cmd($opts,out=>'tabix.out',cmd=>"$$opts{bin}/tabix $wtmp/index.vcf.gz##idx##$wtmp/index.vcf.gz.tbi 1:10000060-10000060");

0 commit comments

Comments
 (0)