-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
test: twister: -s
path requires forward slashes on Windows, didn't before.
#70310
Comments
@glenn-andrews as the |
@hakehuang yes, it works. I know it works. I said above that it works. The entire point of this issue is that in making it work, the PR broke the previous method of specifying the argument to |
because, we meet a problem when build from linux like system, but run on windows system. so I propse this add as '/' is accepted by both Windows and Linux, so we assume use will use it this way. @nashif, do you think we can unified the -s content to '/'? |
So your proposal is to break every test that uses
|
sorry, what I mean is exact solution 1 you propsed. forgive me for ambious description, so the code change is simple as below.
and for
'/' is a path separator accepted by both OS, that;s why we select this as default one, but you are right, we need document this. |
@hakehuang assigning this to you, given you were involved in introduing this issue :-) |
Thank you. Sorry if I was harsh. I had two Twister bugs simultaneously occur, preventing any forward motion until I bisected from 3.5.0 to the present to find both of them. I appreciate your working to fix this. |
@nashif @hakehuang @glenn-andrews |
I lost 2 days of work because I copied tests that worked the previous month to test in a new project, and when they failed with no intelligent error message I assumed it was an error on my part, not that someone had submitted a PR that swapped the direction of the path separator. I personally don't care if it's backslashes, forward slashes or both. I do care I lost two days of productivity to an undocumented breaking change, and I doubt I'm the only developer out there who used the Windows path separators on Windows and found it blew up in their face next time they pulled the latest version. Given so many other things in Zephyr don't care if you use Windows or Linux path separators, why are we hung up on making sure only Linux separators work? Why not swap all |
In my fix PR, all path has been pre normized with '/', please check. Thanks a lot. |
It works for me on Windows. |
Winodws user may use the `\` as path, but in twister we use the common `/` as path separated, to avoid the mis-use, convert it to `/` in twister first normpath, and then replace the os.sep tested by: For Linux Like: west twister -p disco_l475_iot1 -s samples/hello_world/... For Windows: west twister -p disco_l475_iot1 -s samples\hello_world\... fixing: #70310 Signed-off-by: Hake Huang <[email protected]>
Fixed with #70468 |
Using Windows, I had a test that I was running of the following form:
west twister --device-testing --device-serial COM3 --device-serial-baud 115200 -p disco_l475_iot1 -T C:\Users\glenn\zephyrproject\my_app\ -s tests\app\sample.testing.my_app_tests
After #64272 the direction of the path separators in the
-s
option changed without warning:The test did work when the path separators are replaced with
/
e.g.:west twister --device-testing --device-serial COM3 --device-serial-baud 115200 -p disco_l475_iot1 -T C:\Users\glenn\zephyrproject\my_app\ -s tests/app/sample.testing.my_app_tests
It would be nice if it was fixed to work with slashes in either direction.
Impact:
Annoyance. I was stuck for several hours until I bisected the repo and found the diff that changed the separator direction. There's no indication of what caused the problem, and older tests will now fail on Windows when they worked before.
Environment:
Windows 11.
zephyr 0.16.5
Commit: any after #64272
The text was updated successfully, but these errors were encountered: