rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.64k stars 12.49k forks source link

compiletest: `./x test <test-name>.stderr` (or existing non-`.rs` file) should warn or error #126601

Open jieyouxu opened 2 months ago

jieyouxu commented 2 months ago

Noticed by @WaffleLapkin, if you write

./x test tests/ui/parser/bad-let-else-statement.stderr

then compiletest will silently pass but run 0 tests, because bad-let-else-statement.stderr is a tracked stderr file associated with the actual .rs ui test but not a test itself. This might be surprising or give a false sense of security to the person who's running the test suite thinking that the test passed, whereas it actually didn't even run.

We should probably warn or error if the path exists (and has an extension) but is not a valid test file.

veera-sivarajan commented 2 months ago

@rustbot claim