Title: [247763] trunk/Tools
Revision
247763
Author
hironori.fu...@sony.com
Date
2019-07-23 18:33:44 -0700 (Tue, 23 Jul 2019)

Log Message

[webkitperl] prepare-ChangeLog_unittest/parser_unittests.pl is failing on Windows Perl
https://bugs.webkit.org/show_bug.cgi?id=199927

Reviewed by Alex Christensen.

convertAbsolutepathToWebKitPath was failing to convert paths on
Windows Perl due to path separators mismatch.

Renamed convertAbsolutepathToWebKitPath to
convertAbsolutePathToRelativeUnixPath, and changed it to replace
paths to relative Unix paths.

* Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl:
(convertAbsolutePathToRelativeUnixPath): Added.
(convertAbsolutepathToWebKitPath): Deleted.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (247762 => 247763)


--- trunk/Tools/ChangeLog	2019-07-24 00:48:14 UTC (rev 247762)
+++ trunk/Tools/ChangeLog	2019-07-24 01:33:44 UTC (rev 247763)
@@ -1,3 +1,21 @@
+2019-07-23  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [webkitperl] prepare-ChangeLog_unittest/parser_unittests.pl is failing on Windows Perl
+        https://bugs.webkit.org/show_bug.cgi?id=199927
+
+        Reviewed by Alex Christensen.
+
+        convertAbsolutepathToWebKitPath was failing to convert paths on
+        Windows Perl due to path separators mismatch.
+
+        Renamed convertAbsolutepathToWebKitPath to
+        convertAbsolutePathToRelativeUnixPath, and changed it to replace
+        paths to relative Unix paths.
+
+        * Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl:
+        (convertAbsolutePathToRelativeUnixPath): Added.
+        (convertAbsolutepathToWebKitPath): Deleted.
+
 2019-07-23  Alex Christensen  <achristen...@webkit.org>
 
         Fix iOS API test after r247759

Modified: trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl (247762 => 247763)


--- trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl	2019-07-24 00:48:14 UTC (rev 247762)
+++ trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl	2019-07-24 01:33:44 UTC (rev 247763)
@@ -35,7 +35,7 @@
 use LoadAsModule qw(PrepareChangeLog prepare-ChangeLog);
 
 sub captureOutput($);
-sub convertAbsolutepathToWebKitPath($);
+sub convertAbsolutePathToRelativeUnixPath($$);
 sub readTestFiles($);
 
 use constant EXPECTED_RESULTS_SUFFIX => "-expected.txt";
@@ -73,8 +73,8 @@
     my @ranges;
     my ($stdout, $stderr) = captureOutput(sub { @ranges = $parser->(\*FH, $test->{inputFile}); });
     close FH;
-    $stdout = convertAbsolutepathToWebKitPath($stdout);
-    $stderr = convertAbsolutepathToWebKitPath($stderr);
+    $stdout = convertAbsolutePathToRelativeUnixPath($stdout, $test->{inputFile});
+    $stderr = convertAbsolutePathToRelativeUnixPath($stderr, $test->{inputFile});
 
     my %actualOutput = (ranges => \@ranges, stdout => $stdout, stderr => $stderr);
     if ($resetResults) {
@@ -130,12 +130,17 @@
     return ($stdout, $stderr);
 }
 
-sub convertAbsolutepathToWebKitPath($)
+sub convertAbsolutePathToRelativeUnixPath($$)
 {
-    my $string = shift;
-    my $sourceDir = LoadAsModule::sourceDir();
+    my ($string, $path) = @_;
+    my $sourceDir = LoadAsModule::unixPath(LoadAsModule::sourceDir());
+    my $relativeUnixPath = LoadAsModule::unixPath($path);
     $sourceDir .= "/" unless $sourceDir =~ m-/$-;
-    $string =~ s/$sourceDir//g;
+    my $quotedSourceDir = quotemeta($sourceDir);
+    $relativeUnixPath  =~ s/$quotedSourceDir//;
+    my $quotedPath = quotemeta($path);
+    $string =~ s/$quotedPath/$relativeUnixPath/g;
+    $string =~ s/\r//g;
     return $string;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to