Title: [277317] trunk/Tools
Revision
277317
Author
[email protected]
Date
2021-05-10 21:46:49 -0700 (Mon, 10 May 2021)

Log Message

Use non-throwing std::filesystem API in TestRunner
https://bugs.webkit.org/show_bug.cgi?id=225632

Reviewed by Darin Adler.

* TestRunnerShared/TestCommand.cpp:
(WTR::testPath):
(WTR::testURLString):
* TestRunnerShared/TestFeatures.cpp:
(WTR::parseTestHeader):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (277316 => 277317)


--- trunk/Tools/ChangeLog	2021-05-11 04:31:16 UTC (rev 277316)
+++ trunk/Tools/ChangeLog	2021-05-11 04:46:49 UTC (rev 277317)
@@ -1,3 +1,16 @@
+2021-05-10  Chris Dumez  <[email protected]>
+
+        Use non-throwing std::filesystem API in TestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=225632
+
+        Reviewed by Darin Adler.
+
+        * TestRunnerShared/TestCommand.cpp:
+        (WTR::testPath):
+        (WTR::testURLString):
+        * TestRunnerShared/TestFeatures.cpp:
+        (WTR::parseTestHeader):
+
 2021-05-10  Wenson Hsieh  <[email protected]>
 
         [macOS] Allow immediate action gestures to begin when force clicking text inside image overlays

Modified: trunk/Tools/TestRunnerShared/TestCommand.cpp (277316 => 277317)


--- trunk/Tools/TestRunnerShared/TestCommand.cpp	2021-05-11 04:31:16 UTC (rev 277316)
+++ trunk/Tools/TestRunnerShared/TestCommand.cpp	2021-05-11 04:46:49 UTC (rev 277317)
@@ -120,7 +120,8 @@
     if (pathOrURL.find("file://") == 0)
         return pathOrURL.substr(strlen("file:/"));
 
-    return std::filesystem::absolute(pathOrURL);
+    std::error_code ec;
+    return std::filesystem::absolute(pathOrURL, ec);
 }
 
 std::string testURLString(const std::string& pathOrURL)
@@ -128,7 +129,8 @@
     if (pathOrURL.find("http://") == 0 || pathOrURL.find("https://") == 0 || pathOrURL.find("file://") == 0)
         return pathOrURL;
 
-    return "file://" + std::filesystem::absolute(pathOrURL).generic_string();
+    std::error_code ec;
+    return "file://" + std::filesystem::absolute(pathOrURL, ec).generic_string();
 }
 
 }

Modified: trunk/Tools/TestRunnerShared/TestFeatures.cpp (277316 => 277317)


--- trunk/Tools/TestRunnerShared/TestFeatures.cpp	2021-05-11 04:31:16 UTC (rev 277316)
+++ trunk/Tools/TestRunnerShared/TestFeatures.cpp	2021-05-11 04:46:49 UTC (rev 277317)
@@ -246,7 +246,8 @@
 static TestFeatures parseTestHeader(std::filesystem::path path, const std::unordered_map<std::string, TestHeaderKeyType>& keyTypeMap)
 {
     TestFeatures features;
-    if (!std::filesystem::exists(path))
+    std::error_code ec;
+    if (!std::filesystem::exists(path, ec))
         return features;
 
     std::ifstream file(path);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to