Uh oh!
There was an error while loading. Please reload this page.
Add compile-pass mode to compiletest - #44522
Conversation
rustc itself does not use this, but this is really useful for other clients of compiletest, e.g., miri.
rust-highfive
commented
Sep 12, 2017
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
Hmm I thought our usual way to handle this was to force (via an attribute)
Update: I'm not saying that I prefer the above hack to having a dedicated |
miri needs this because there is no binary being produced, so running the test makes no sense (and indeed, for "cross-interpretation", is not possible). rustc is in a different situation, so why would rustc need this? That test, to me, looks more like it tests the But then there is e.g. https://github.com/rust-lang/rust/blob/b1363a73ede57ae595f3a1be2bb75d308ba4f7f6/src/test/compile-fail/privacy/restricted/lookup-ignores-private.rs... |
oli-obk
commented
Sep 13, 2017
The difference between There are many This also means that many |
RalfJung
commented
Sep 13, 2017
What do you man by "check warnings etc."? Should things be I am happy to move some existing |
oli-obk
commented
Sep 13, 2017
I mean it ignores
No, that can be enabled when explicitly checking whether some test does not emit certain warnings, but should not be turned on in general imo. |
RalfJung
commented
Sep 13, 2017
Oh I see. But for tests that don't have anything like that (e.g. this one), making the
Tests like this? However, it has some "pretty-expanded" flag, so something still seems to be going on somewhere... |
oli-obk
commented
Sep 13, 2017
yes
I'm not sure about that one either. |
RalfJung
commented
Sep 13, 2017
It seems the test suites to run are defined in None of these folders even exist... |
RalfJung
commented
Sep 13, 2017
I moved all run-pass tests that have a line matching I can do similar things for compile-fail, though the grepping will have to be a little more careful there I suppose. |
RalfJung
commented
Sep 13, 2017
Ah dang this is a little overeager and moves too many tests... I'll try sth. more conservative |
RalfJung
commented
Sep 13, 2017
All right, I moved everything that matches |
kennytm
commented
Sep 13, 2017
Does |
RalfJung
commented
Sep 13, 2017
It invokes I am fine not moving any tests around here; all I really care about is having this test mode available for miri.^^ |
oli-obk
commented
Sep 13, 2017
That's up to rustc/miri. If the compilation stops early, noone will notice, because noone tries to use the final binary. Miri simply stops compilation before it reaches trans (on non-host targets) |
kennytm
commented
Sep 13, 2017
Not really, e.g. if you referred to an undefined external symbol, it will not fail until reaching the linker. |
I verified that the compile-pass tests all only have one Let me know if you'd prefer me to
|
OK so -- This is not the direction that I want to move in (personally) for our test suite. I would prefer to be grouping tests by the functionality that they test and not the mode that they run in. More specifically, my plan was to unify
We currently have the ability to define "run-pass" I wrote about this here in this internals thread (with this addendum) and I still personally think it's the way to go. That said, I have wanted the ability to write |
oli-obk
commented
Sep 15, 2017
Hmm... our compile-fail tests can't be ui tests, but maybe our run pass tests could be. |
nikomatsakis
commented
Sep 15, 2017
@oli-obk why can't your compile-fail tests be |
oli-obk
commented
Sep 16, 2017
I tried it once. Since we generate a stacktrace on failures, the output differs between the emulated platforms, since libstd's condiuonal compilation produces different functions. We might be able to reduce some cases, but many are impossible |
We'd also have to re-create all ui files if the libstd stack trace "above main" ever changes, which sounds like a pain.
Fair enough. As I already said above, I am no no way attached to moving existing rustc tests around, and I can take the 2nd commit out of this PR. Would that work for you? I noticed that ui tests have a conditional in compiletest to control whether the test is run, but I could not figure out so far how that conditional is controlled: rust/src/tools/compiletest/src/runtest.rs Line 2209 in 3a7ab6c EDIT: Ah, it seems one says |
RalfJung
commented
Sep 16, 2017
It actually seems like ui tests work very well for miri's run-pass suite, see rust-lang/miri#343. |
rustc itself does not use this, but this is really useful for other clients of compiletest, e.g., miri.
Currently, miri uses some pretty epic hacks to work around not having this -- see for yourself in rust-lang/miri#334.