Make autotest.py support forward slash on Windows
Currently, autotest.py doesn't support the forward slash '/' as a path separator on Windows. For example: Succeeds: python3 tools/autotest.py -C out/bug base\at_exit_unittest --gtest_filter=*Exit* Fails: python3 tools/autotest.py -C out/bug base/at_exit_unittest --gtest_filter=*Exit* This is because RecursiveMatchFilename() considers a file a match with the requested filename if the requested filename is a substring of the file's full path. On Windows, file paths as returned by os.scandir() use '\\' as a path separator, so a path using '/' will never match (e.g. 'base/at_exit_unittest' is not a substring of 'C:\\src\\chromium\\src\\base\\at_exit_unittest.cc'). With this change, either type of path separator works on Windows. Change-Id: Ic21eff291d86e7ca994faeda807f6aeaff737562 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2181744 Commit-Queue: Jesse McKenna <jessemckenna@google.com> Reviewed-by:Michael Thiessen <mthiesse@chromium.org> Cr-Commit-Position: refs/heads/master@{#766500}
Showing
Please register or sign in to comment