-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Use python3's pathlib in test code. NFC #14175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6aa5010 to
69b3b96
Compare
kripken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good. We don't have a lot of windows testing here though, have you done any additional tests, or do you think this is enough?
Maybe I can do a CI run with windows running all of wasm2 and other? That should do it. |
|
Sounds good. I guess the autoroller will also catch this eventually too. |
fd80061 to
b914616
Compare
|
All windows tests in other and wasm2 pass.. except for |
rth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows us to use unix-like paths throughout the tests that will
get converted to windows-paths on windows machines automatically
by the pathlib library.
Interesting, I wasn't aware this was possible. Thanks for working on this!
There are plans underway to start using pathlib more in emscripten. See: #14074 This change a designed to test the water by using `pathlib` in test code. This allows us to use unix-like paths throughout the tests that will get converted to windows-paths on windows machines automatically by the pathlib library.
b914616 to
0462788
Compare
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
Followup to #14175. Again I think this makes many tests more readable.
This change is very much like that large change I made to the test suite. See #14191 and #14175. It enables is to use unix style paths rather than arrays of path components which has several advantages. As well as beeing more readable and writable it also allows for things like `git grep "musl/src"` to work as expected. For an example of how much more readable it makes the code see `tools/system_libs.py`. This change was made almost exclusively with a bunch of `sed` commands. Because there is likely some minor performance overhead I did some measurements. Running `./tests/runner wasm2 --skip-slow`: before: real 1m10.403s user 49m40.135s sys 6m14.466s after: real 1m10.397s user 49m43.849s sys 6m10.698s Running `./embuilder build libc --force`: before: real 0m5.597s user 3m2.721s sys 0m50.843s after: real 0m5.609s user 3m0.998s sys 0m49.796s
This change is very much like that large change I made to the test suite. See #14191 and #14175. It enables is to use unix style paths rather than arrays of path components which has several advantages. As well as beeing more readable and writable it also allows for things like `git grep "musl/src"` to work as expected. For an example of how much more readable it makes the code see `tools/system_libs.py`. This change was made almost exclusively with a bunch of `sed` commands. Because there is likely some minor performance overhead I did some measurements. Running `./tests/runner wasm2 --skip-slow`: before: real 1m10.403s user 49m40.135s sys 6m14.466s after: real 1m10.397s user 49m43.849s sys 6m10.698s Running `./embuilder build libc --force`: before: real 0m5.597s user 3m2.721s sys 0m50.843s after: real 0m5.609s user 3m0.998s sys 0m49.796s
This change is very much like that large change I made to the test suite. See #14191 and #14175. It enables is to use unix style paths rather than arrays of path components which has several advantages. As well as beeing more readable and writable it also allows for things like `git grep "musl/src"` to work as expected. For an example of how much more readable it makes the code see `tools/system_libs.py`. This change was made almost exclusively with a bunch of `sed` commands. Because there is likely some minor performance overhead I did some measurements. Running `./tests/runner wasm2 --skip-slow`: before: real 1m10.403s user 49m40.135s sys 6m14.466s after: real 1m10.397s user 49m43.849s sys 6m10.698s Running `./embuilder build libc --force`: before: real 0m5.597s user 3m2.721s sys 0m50.843s after: real 0m5.609s user 3m0.998s sys 0m49.796s
This change is very much like that large change I made to the test suite. See #14191 and #14175. It enables is to use unix style paths rather than arrays of path components which has several advantages. As well as beeing more readable and writable it also allows for things like `git grep "musl/src"` to work as expected. For an example of how much more readable it makes the code see `tools/system_libs.py`. This change was made almost exclusively with a bunch of `sed` commands. Because there is likely some minor performance overhead I did some measurements. Running `./tests/runner wasm2 --skip-slow`: before: real 1m10.403s user 49m40.135s sys 6m14.466s after: real 1m10.397s user 49m43.849s sys 6m10.698s Running `./embuilder build libc --force`: before: real 0m5.597s user 3m2.721s sys 0m50.843s after: real 0m5.609s user 3m0.998s sys 0m49.796s
This change is very much like that large change I made to the test suite. See #14191 and #14175. It enables is to use unix style paths rather than arrays of path components which has several advantages. As well as beeing more readable and writable it also allows for things like `git grep "musl/src"` to work as expected. For an example of how much more readable it makes the code see `tools/system_libs.py`. This change was made almost exclusively with a bunch of `sed` commands. Because there is likely some minor performance overhead I did some measurements. Running `./tests/runner wasm2 --skip-slow`: before: real 1m10.403s user 49m40.135s sys 6m14.466s after: real 1m10.397s user 49m43.849s sys 6m10.698s Running `./embuilder build libc --force`: before: real 0m5.597s user 3m2.721s sys 0m50.843s after: real 0m5.609s user 3m0.998s sys 0m49.796s
…FC (#14916) This change is very much like that large change I made to the test suite. See #14191 and #14175. It enables is to use unix style paths rather than arrays of path components which has several advantages. As well as beeing more readable and writable it also allows for things like `git grep "musl/src"` to work as expected. For an example of how much more readable it makes the code see `tools/system_libs.py`. This change was made almost exclusively with a bunch of `sed` commands. Because there is likely some minor performance overhead I did some measurements. Running `./tests/runner wasm2 --skip-slow`: before: real 1m10.403s user 49m40.135s sys 6m14.466s after: real 1m10.397s user 49m43.849s sys 6m10.698s Running `./embuilder build libc --force`: before: real 0m5.597s user 3m2.721s sys 0m50.843s after: real 0m5.609s user 3m0.998s sys 0m49.796s
There are plans underway to start using pathlib more in emscripten.
See: #14074
This change a designed to test the water by using
pathlibin testcode.
This allows us to use unix-like paths throughout the tests that will
get converted to windows-paths on windows machines automatically
by the pathlib library.
For example: