1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 16:48:49 -05:00

tests: use \r\n for log messages in WSL

Bash in Windows Subsystem for Linux (WSL) requires it for some reason.

(This is one of several commits to support use of WSL for the tests.)

Ref: https://github.com/curl/curl/pull/3899
This commit is contained in:
Marc Hoersken 2019-05-18 23:26:48 +02:00 committed by Jay Satiro
parent 476a832094
commit 0783f2e585

View File

@ -206,6 +206,9 @@ my $valgrind_tool;
my $gdb = checktestcmd("gdb");
my $httptlssrv = find_httptlssrv();
my $uname_release = `uname -r`;
my $is_wsl = $uname_release =~ /Microsoft$/;
my $has_ssl; # set if libcurl is built with SSL support
my $has_largefile; # set if libcurl is built with large file support
my $has_idn; # set if libcurl is built with IDN support
@ -324,7 +327,12 @@ my $tortalloc;
#
sub logmsg {
for(@_) {
print "$_";
my $line = $_;
if ($is_wsl) {
# use \r\n for WSL shell
$line =~ s/\r?\n$/\r\n/g;
}
print "$line";
}
}