-
Notifications
You must be signed in to change notification settings - Fork 349
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
Move test suite to ui tests and bless stderr output #2032
Conversation
Nice, thanks! I was not sure yet whether we'd want to merge the passing and failing tests... it is quite nice to be able to immediately see which kind of test this is, and this requires a lot more reorganization. But I guess it makes sense to follow rustc here. |
Yea I was a bit surprised how the run-pass tests don't need any flags (like Anyway, right now we have a problem: paths to the sysroot are flaky, as they depend on where your sysroot is. Gotta figure out how rustc handles this. |
I reverted the directory moves for now |
hmm... gotta figure out how to handle the optimized stderr |
Yeah compiletest lags behind the rustc code by a lot by now, and fails to check the exist status most of them time. Plus things like Manishearth/compiletest-rs#123. Maybe we should use https://crates.io/crates/trybuild instead?^^ (Not sure if that's actually possible.) EDIT: Looking at its API -- no that is probably not possible. |
Ah, yeah, that has been a problem sometimes even with compile-fail and is a lot worse with |
We'll also have to normalize Alloc IDs and SB Tags in many places. Is there a way to add a "default normalizer" to compiletest so we don't have to add the same |
Yea, I haven't figured this out yet.. maybe I can add something to the miri binary instead that filters all the stderr output |
Is patching compiletest an option? Shouldn't be too hard to add a new field to the config struct and using that to initialize TestProps. |
You can set the |
☔ The latest upstream changes (presumably #1975) made this pull request unmergeable. Please resolve the merge conflicts. |
@oli-obk what are your plans for this? I would love to see this happen. :) |
I talked with pnkfelix about it yesterday. I'm going to add default filters to compiletest, and once that is merged, bump the crates.io version and then we can set some default filters here. That'll probably take a bit tho |
Sounds like a great plan. :) compiletest-rs is quite far behind the rustc version, FWIW. As in, many years. Doing a bump might be more like re-doing the extraction from scratch rather than updating the existing thing... |
oof yea, I looked at this. And remembered I tried this before... Not sure what the best way forward is, but I think this is a larger project. I don't want to do the change just in the crates.io version, but re-doing a sync when it's just going to get out of sync again is also not great. |
Yeah, just doing the change on crates.io is where I would have started. It's terrible but I gave up my hopes for this getting back in sync.^^ Or we go the low-tech way and simply have a common prelude in all our test files, and some ad-hoc hacky scripts to update it when needed... |
ab2648f
to
fe38f1b
Compare
Now I just gotta get back |
@RalfJung once I get all the targets working, I would like to merge this. While there are still minor bugs that I want to fix before merging, there is one major missing feature that I need to fix: Opinions? |
🚀 CI is passing. I'll see if it still works if we run it from within the rustc repo |
Ah, so that will be hard to normalize as well. |
tests/compiletest.rs
Outdated
ui(Mode::UB, "tests/compile-fail", &target); | ||
ui(Mode::Pass, "tests/run-pass"); | ||
ui(Mode::Panic, "tests/run-fail"); | ||
ui(Mode::UB, "tests/compile-fail"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the names of the folders, maybe we should call the variants RunFail
and CompileFail
?
Though "compile-fail" is not a great name and we should probably rename the folder instead...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to cause the folder renaming churn.
I want run-pass
, run-panic
and run-fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to cause the folder renaming churn.
Fair, we can leave that to a separate PR.
I want run-pass, run-panic and run-fail
The "run" part looks rather redundant in these names...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeaaa... we don't really have compile-fail tests, so leaving out the run part makes sense
@@ -123,5 +128,5 @@ fn main() { | |||
|
|||
ui(Mode::Pass, "tests/run-pass"); | |||
ui(Mode::Panic, "tests/run-fail"); | |||
ui(Mode::UB, "tests/compile-fail"); | |||
ui(Mode::Fail, "tests/compile-fail"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what about "pass", "panic", and "fail" for the folder names?
I addressed all review comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks great! I left a bunch of comments/nits on the ui test library. I didn't re-check the test output itself; that part is probably easier to tweak post-landing. I also didn't check the details of how the library prints test failures, and the comment parsing. It seems to work well enough for now. :)
Addressed all comments and rebased (no squashing or other history editing) |
Apart from these last two nits, LGTM. Please squash and land. :-) |
@bors r+ |
@bors ping |
😪 I'm awake I'm awake |
@bors r+ |
📌 Commit f1756c3 has been approved by |
☀️ Test successful - checks-actions |
fixes #2027