-
Notifications
You must be signed in to change notification settings - Fork 12.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
make run-pass tests with empty main just compile-pass tests #54680
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
r? @pnkfelix |
It seems like this PR is moving a number of the Long term I wouldn't care, because I am hoping to revise the directory structure to get rid of Does it not work to tag these tests as |
I seem to recall this historically not being an automatable change because some of the tests are verifying link pass (possibly dynamic link pass?), and maybe llvm-pass, which I'm not sure is the case with compile-pass tests. |
I thought the directories were supposed to be sorted by the kind of their test.
Ah, dang. I can move everything pack that mentions "link" in any way and everything that has auxiliary files. Not sure if that'd be enough. |
Well, not entirely. compile-pass tests are faster than run-pass tests. And we already have tons of compile-pass tests in |
26a6025
to
1b22bef
Compare
We are trying to work our way towards a world where the tests are sorted by language feature (and maybe by compiler module). Eventually, the compile-fail and run-pass distinctions are, I think, going to be solely encoded in per-test metadata embedded in the source text. (Ie everything will be a ui test.) But since we aren’t there yet (in terms of not being able to select eg all the run-pass tests in every suite), i would prefer to leave the tests that generate no diagnostic output in their current positions in the file system, if the If the flag doesn’t work in that context for some reason, then I guess we can just move the files (And of course, the best thing might be to actually turn each of these tests into meaningful run-pass tests that actually exercise the dynamic semantics...?) |
I don't agree. Many of these just make sure something compiles. They test the type checker to accept stuff, and are not interested in actually running any code.
I can make that happen for these tests. However, there are already close to 200 |
But anyway that doesn't even seem to work. This panics even when I have
Not sure why it would do that... EDIT: Actually, looking at this line that's not surprising. |
Okay. I agree that in those cases there's no reason to put in an actual
Hmm. I would suggest we collapse the first two arms in: rust/src/tools/compiletest/src/runtest.rs Lines 265 to 268 in ddb1a2a
to just say: Okay fine I'll just r+ this so we can stop trying to slap band-aids on this in the short term. |
@bors r+ |
📌 Commit 1b22bef has been approved by |
@bors r- Just realized that we haven't resolved this question:
(I assume "move everything pack" there was meant to be "move everything back" ...) |
Yes, I did grep for "link" and moved everything back that had that term in it. I also just realized some tests used |
@bors r+ |
📌 Commit 454b14a has been approved by |
make run-pass tests with empty main just compile-pass tests Many run-pass tests have an empty main, so there is not actually any point in running them. This makes them `compile-pass` tests instead, saving some time (generating the binary and then running it). For now I did this only for `run-pass/issues`; if there is interest I can also do it for the other directories. I used `^\s*fn\s+main\(\s*\)\s*\{\s*\}` as regexp to identify these files.
make run-pass tests with empty main just compile-pass tests Many run-pass tests have an empty main, so there is not actually any point in running them. This makes them `compile-pass` tests instead, saving some time (generating the binary and then running it). For now I did this only for `run-pass/issues`; if there is interest I can also do it for the other directories. I used `^\s*fn\s+main\(\s*\)\s*\{\s*\}` as regexp to identify these files.
Rollup of 10 pull requests Successful merges: - #54269 (#53840: Consolidate pattern check errors) - #54458 (Allow both explicit and elided lifetimes in the same impl header) - #54603 (Add `crate::` to trait suggestions in Rust 2018.) - #54648 (Update Cargo's submodule) - #54680 (make run-pass tests with empty main just compile-pass tests) - #54687 (Use impl_header_lifetime_elision in libcore) - #54699 (Re-export `getopts` so custom drivers can reference it.) - #54702 (do not promote comparing function pointers) - #54728 (Renumber `proc_macro` tracking issues) - #54745 (make `CStr::from_bytes_with_nul_unchecked()` a const fn) Failed merges: r? @ghost
Hmm. How can we best prevent cases like #44056 from being swept up in changes like this in the future... |
Many run-pass tests have an empty main, so there is not actually any point in running them. This makes them
compile-pass
tests instead, saving some time (generating the binary and then running it).For now I did this only for
run-pass/issues
; if there is interest I can also do it for the other directories. I used^\s*fn\s+main\(\s*\)\s*\{\s*\}
as regexp to identify these files.