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

x.py test specific directory requires platform specific path separator #79334

Closed
Havvy opened this issue Nov 23, 2020 · 3 comments
Closed

x.py test specific directory requires platform specific path separator #79334

Havvy opened this issue Nov 23, 2020 · 3 comments
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Havvy
Copy link
Contributor

Havvy commented Nov 23, 2020

On Windows, I tried this code:

python x.py test src/test/ui/expr/compound-assignment/eval-order.rs --pass run

I expected to execute the file and give back a test result. Instead, it found zero results.

After an hour of flailing, I tired:

python x.py test src/test/ui\expr\compound-assignment\eval-order.rs --pass run

And to my (pleasant) surprised, it found the file.

Ideally, it shouldn't matter which path separator is used at any point.

@Havvy Havvy added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Nov 23, 2020
@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels Nov 23, 2020
@jyn514
Copy link
Member

jyn514 commented Aug 8, 2022

This is an issue with libtest - compiletest passes in expr/compound-assignment/eval-order.rs as the filter, which libtest counts as filtering out expr\compound-assignment\eval-order.rs too.

I think the workaround is to manually turn forward slashes into backslashes in impl Step for test::Compiletest when running on windows.

@jyn514 jyn514 added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. O-windows Operating system: Windows labels Aug 8, 2022
@czzrr
Copy link
Contributor

czzrr commented Aug 9, 2022

@rustbot claim

JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 23, 2022
Fix wrong compiletest filters on Windows

As discussed in [rust-lang#79334](rust-lang#79334), when calling e.g.
```
python x.py test src/test/ui/expr/compound-assignment/eval-order.rs
```
on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed.

I'm not sure how to organize a test for this. Any suggestions?
JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 24, 2022
Fix wrong compiletest filters on Windows

As discussed in [rust-lang#79334](rust-lang#79334), when calling e.g.
```
python x.py test src/test/ui/expr/compound-assignment/eval-order.rs
```
on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed.

I'm not sure how to organize a test for this. Any suggestions?
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 24, 2022
Fix wrong compiletest filters on Windows

As discussed in [rust-lang#79334](rust-lang#79334), when calling e.g.
```
python x.py test src/test/ui/expr/compound-assignment/eval-order.rs
```
on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed.

I'm not sure how to organize a test for this. Any suggestions?
compiler-errors added a commit to compiler-errors/rust that referenced this issue Aug 27, 2022
Fix wrong compiletest filters on Windows

As discussed in [rust-lang#79334](rust-lang#79334), when calling e.g.
```
python x.py test src/test/ui/expr/compound-assignment/eval-order.rs
```
on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed.

I'm not sure how to organize a test for this. Any suggestions?
JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 27, 2022
Fix wrong compiletest filters on Windows

As discussed in [rust-lang#79334](rust-lang#79334), when calling e.g.
```
python x.py test src/test/ui/expr/compound-assignment/eval-order.rs
```
on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed.

I'm not sure how to organize a test for this. Any suggestions?
@jyn514
Copy link
Member

jyn514 commented Sep 19, 2022

Looks like this was fixed in #100811 :) thanks @czzrr !

@jyn514 jyn514 closed this as completed Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. O-windows Operating system: Windows T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants