Skip to content

Commit 5019d5c

Browse files
committed
TESTrun: Address remaining known issues with Windows.
According to Gisle Vanem, this is sufficient to run the script using Cygwin64 and to see 116 tests skipped and the rest passed.
1 parent 86232c3 commit 5019d5c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

testprogs/TESTlib.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ my %osnames = (
3131
haiku => 'Haiku',
3232
hpux => 'HP-UX',
3333
linux => 'Linux',
34-
MSWin32 => 'Windows',
34+
msys => 'Windows',
3535
netbsd => 'NetBSD',
3636
openbsd => 'OpenBSD',
3737
solaris => 'illumos/Solaris',

testprogs/TESTrun

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ sub skip_unless_file_contains_lines {
162162

163163
open FH, '<', $filename or return $skip;
164164
while (<FH>) {
165-
chomp;
165+
s/[\r\n]*$//o; # chomp() removes LF, but not CR, even on Windows.
166166
next unless exists $notfound{$_};
167167
delete $notfound{$_};
168168
last unless scalar keys %notfound;
@@ -225,7 +225,7 @@ sub skip_no_ethers {
225225
$cached_skip_no_ethers =
226226
# pcap_ether_hostton() currently cannot guess a suitable
227227
# location for the libpcap-only ethers(5).
228-
skip_os ('MSWin32') ||
228+
skip_os ('msys') ||
229229
skip_unless_file_contains_lines (
230230
$^O eq 'haiku' ? '/boot/system/settings/network/ethers' :
231231
'/etc/ethers',
@@ -253,11 +253,11 @@ sub skip_no_ethers_casecmp {
253253
# with dual-stack hostnames) to be practicable.
254254
my $cached_skip_no_hosts;
255255
sub skip_no_hosts {
256-
return '%SYSTEMROOT% not set' if $^O eq 'MSWin32' && ! defined $ENV{SYSTEMROOT};
256+
return '%SYSTEMROOT% not set' if $^O eq 'msys' && ! defined $ENV{SYSTEMROOT};
257257
$cached_skip_no_hosts = skip_unless_file_contains_lines (
258258
$^O eq 'haiku' ? '/boot/system/settings/network/hosts' :
259259
$^O eq 'solaris' ? '/etc/inet/hosts' :
260-
$^O eq 'MSWin32' ? "${ENV{SYSTEMROOT}}\\system32\\drivers\\etc\\hosts" :
260+
$^O eq 'msys' ? "${ENV{SYSTEMROOT}}\\system32\\drivers\\etc\\hosts" :
261261
'/etc/hosts',
262262
@hosts_lines
263263
) unless defined $cached_skip_no_hosts;

0 commit comments

Comments
 (0)