Repository navigation
Closed
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.Relevant to the infrastructure team, which will review and decide on the PR/issue.
Description
So, by and large, compiletest is untested, as far as I know. That is -- there are no 'self tests' to make sure that it's acting as it should, invoking revisions the way we expect, and so forth. This could be a bit of a tricky thing to do, but it's definitely worth the effort.
For example, an early version of #47605 had a subtle bug where it appeared to be working, but in fact was not passing the revision info through to the final test. I don't think this would have bothered travis one bit, as that would have happily run the same revision over and over.
cc @spastorino @oli-obk ... we need like a compiletest team, don't why? :)
Reacted by Iago-lito
Reacted by LifeIsStrange
Metadata
Metadata
Assignees
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.E-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.Relevant to the infrastructure team, which will review and decide on the PR/issue.
Type
Projects
- StatusShow more project fieldsBacklog
Activity
oli-obk commentedon Jan 20, 2018
I have some beef with compiletest in general. Instead of having this unstable (as in nightly) library that contains a somewhat random list of test kinds that all behave subtly different, we should probably write a stable extensible library that is distributed via crates.io, developed like any other library (so it has tests) and uses cargo instead of manually calling rustc and hoping for the best.
So, the list of issues off the top of my head:
spastorino commentedon Jan 20, 2018
I'd be happy to work on a library like this if we can have a conversation about what is exactly needed :).
killercup commentedon Jan 20, 2018
@spastorino I started working on a very simple version of this to test clippy's diagnostics output as well as that its suggestions work as intended (when applied by rustfix). I'll have something up in later today, and will ping you in the clippy PR :)
In the meantime, feel free to say hello in the #clippy channel on irc.mozilla.org :)
nikomatsakis commentedon Jan 22, 2018
While I don't disagree, I feel a bit wary here. I'm fine with making a new testing setup, but it feels like the kind of thing that will derail progress for a long time. And I'm not convinced that the compiler's needs (e.g., things like mir-opt tests) will be satisfied by a more generic setup.
Unless you have a clear candidate of what test runner we should adopt, I'd rather see us move towards simplifying and centralizing things gradually and then at some later point perhaps switch. (Centralizing run-pass, compile-fail, and ui seems like an example of something we can do to simplify things now.)
Rollup merge of rust-lang#56792 - phansch:add_compiletest_testsuite, …
Rollup merge of rust-lang#56841 - phansch:add_various_compiletest_uni…
steveklabnik commentedon Sep 22, 2019
Triage; Looks like Pietro has added a bit of testing, but it's "just a start"
jyn514 commentedon Nov 9, 2022
One way to test compiletest is to add more UI tests that test compiletests' behavior, instead of rustc's. See for example https://github.com/rust-lang/rust/pull/103298/files#diff-6542cbbb7ad12df6cb2daadaf279589c5c1712906cd14222c03132ad5a49d590. I think using that instead of a new framework has several advantages:
I think it should be fairly simple to keep adding tests to
src/test/ui/compiletest-selftestas necessary; I don't have a set of initial tests in mind though.oli-obk commentedon Nov 9, 2022
I wrote a new ui test framework that miri uses and I'm working on getting ready for clippy to use. It uses itself to test its own output.
jyn514 commentedon Nov 9, 2022
Sounds like there is duplicate work between that and #103266
Alexendoo commentedon Nov 15, 2022
It could well be, mainly I went forward with #103266 to avoid the other duplicate work of adding things to https://github.com/Manishearth/compiletest-rs that the in tree one already has. For example the JSON output after every test failure is pretty rough
jieyouxu commentedon Dec 12, 2025
I'm going to close this issue because it's quite dated, though the "who tests the tester" challenge very much is still a problem -- and will continue to be so due to the nature of the things compiletest has to support. Some remarks:
I am very much in agreement with this assessment, there's a lot of complexity in compiletest, especially in cases where compiletest and the $thing_under_test needs to collaborate to be able to effectively test something.