Skip to content
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

[Bug]: marker_uitest doesn't handle paths correctly, causing $DIR replacements to fail #276

Closed
xFrednet opened this issue Oct 7, 2023 · 0 comments · Fixed by #277
Closed
Assignees
Labels
A-marker-uitest Area: ui-test infrastructure (marker_uitests) C-bug Category: Something isn't working
Milestone

Comments

@xFrednet
Copy link
Member

xFrednet commented Oct 7, 2023

Summary

Marker's ui test crate provides the simple_ui_test_config! macro, with uses tests/ui as the default hard-coded path. Running the tests on windows will result in path with different types of separators, like tests/ui\windows.rs. This is also the reason why the $DIR replacement has been weird in this repo.

@Alexendoo suggested the following nice fix:

std::path::PathBuf::from_iter(std::path::Path::new($ui_dir))

And also mentioned another bug:

p.s. this $ui_dir isn't used docs.rs/marker_uitest/latest/src/marker_uitest/lib.rs.html#33


This bug only effects windows and there are workarounds, by either not testing on windows (this is what markers lint-crate-template does) or avoiding the macro: rust-marker/marker-example-lints#5. I'm uncertain if we should have a point release, maybe if there are more bugs I've missed

Version

cargo-marker 0.3.0

Context

cc: oli-obk/ui_test#177

@xFrednet xFrednet added C-bug Category: Something isn't working A-marker-uitest Area: ui-test infrastructure (marker_uitests) labels Oct 7, 2023
@xFrednet xFrednet self-assigned this Oct 7, 2023
@xFrednet xFrednet added this to the v0.4.0 milestone Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-marker-uitest Area: ui-test infrastructure (marker_uitests) C-bug Category: Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant