Uh oh!
There was an error while loading. Please reload this page.
Convert run-make/coverage-reports tests to use a custom compiletest mode - #112300
Conversation
rustbot
commented
Jun 5, 2023
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Zalathar
commented
Jun 5, 2023
The part I’m least confident about is the implied |
This comment was marked as outdated.
This comment was marked as outdated.
Zalathar
commented
Jun 5, 2023
@rustbot label +A-code-coverage |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
wesleywiser
commented
Jun 6, 2023
This part looks ok to me but if @jyn514 wants to check as well, that would be awesome!
If I recall correctly, code coverage isn't supported on windows-gnu which is why the tests ignore it. |
Rebased and added some small tweaks based on feedback:
I haven't looked into the |
Zalathar
commented
Jun 7, 2023
In light of still needing to support |
Zalathar
commented
Jun 7, 2023
OK, I’ve fundamentally changed how the mode-implied directives work.
This is still a little bit gross, but I think it’s the best compromise for now. |
Zalathar
commented
Jun 7, 2023
(A side-effect of the above is that it’s no longer necessary to move |
run-make/coverage-reports tests to use a custom compiletest moderun-make/coverage-reports tests to use a custom compiletest modeZalathar
commented
Jun 12, 2023
I've now migrated all of the |
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
Zalathar
commented
Jun 12, 2023
Looks like this is all working again now. |
Zalathar
commented
Jun 12, 2023
Dealing with
So while it feels a bit weird to introduce a whole extra suite for one test, I think it ends up being the more natural solution. |
wesleywiser
left a comment
There was a problem hiding this comment.
This is looking pretty good to me! I noticed there used to be a mechanism in the coverage makefile to bless the tests, does --bless still work?
There was a problem hiding this comment.
Thanks for including these FIXMEs here, that will make it easier to understand in the future when they can be removed!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Zalathar
commented
Jun 13, 2023
Yes, |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#111322 (Support for native WASM exceptions) - rust-lang#112086 (resolve: Remove artificial import ambiguity errors) - rust-lang#112234 (refactor `tool_doc!`) - rust-lang#112300 (Convert `run-make/coverage-reports` tests to use a custom compiletest mode) - rust-lang#112795 (Migrate some rustc_builtin_macros to SessionDiagnostic) - rust-lang#113144 (Make the `Elaboratable` trait take clauses) - rust-lang#113161 (Fix type privacy lints error message) r? `@ghost` `@rustbot` modify labels: rollup
Re-enable some coverage tests on Linux These tests were originally disabled (on all platforms) in rust-lang#110393, because those changes had made them start failing on Linux for unclear reasons. I tried to re-enable them unconditionally in rust-lang#111179, since they worked locally on my Mac, but I found that they were still failing on Linux, so I gave up at that time. Later while working on rust-lang#112300 I was able to re-enable them on Windows and Mac, since those changes made it possible to add specific `ignore-` directives to individual tests. I noticed at the time that the tests actually seemed to be working again on Linux, but by that point I didn't want to risk more CI failures, so I left them disabled on Linux with an intention to re-enable them later. Now I'm going back to re-enable them on Linux too, since they seem to work fine. --- Because `run-coverage` tests are sensitive to line numbers, and `x test tidy` doesn't like leading blank lines, I've replaced the old comment/ignore with an informative comment that occupies the same number of lines.
Prior to rust-lang#114875, these tests were very sensitive to lines being added/removed, so the migration to `run-coverage` in rust-lang#112300 tried hard to avoid disturbing the existing line numbers. That resulted in some awkward reshuffling when certain comments/directives needed to be added or moved. Now that we don't have to worry about preserving line numbers, we can rearrange those comments into a more conventional layout.
The demangler was only needed by coverage tests, but those tests were migrated into their own custom test mode in rust-lang#112300. This avoids having to build the demangler just for run-make tests. It will still be built as needed by run-coverage tests or for other purposes.
The demangler was only needed by coverage tests, but those tests were migrated into their own custom test mode in rust-lang#112300. This avoids having to build the demangler just for run-make tests. It will still be built as needed by run-coverage tests or for other purposes.
Avoid unnecessary builds/rebuilds of `rust-demangler` This is a combination of two loosely-related changes: - Don't build `rust-demangler` as a dependency of `tests/run-make`, because after rust-lang#112300 none of the remaining run-make tests actually use it. (If future run-make tests ever do need the demangler, it'll be easy to add it back.) - For `tests/run-coverage`, build the demangler with the stage 0 compiler instead of the current-stage compiler. This avoids having to uselessly rebuild the demangler after modifying and rebuilding the compiler itself.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
Move the extra directives for `Mode::CoverageRun` into `iter_header` When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
I was frustrated by the fact that most of the coverage tests are glued together with makefiles and shell scripts, so I tried my hand at converting most of them over to a newly-implemented
run-coveragemode/suite in compiletest.This
mostlyresolves#85009,though I've left a small number of the existing tests as-is because they would require more work to fix/support.I had time to go back and add support for the more troublesome tests that I had initially skipped over, so this PR now manages to completely get rid of
run-make/coverage-reports.The patches are arranged as follows:
run-make/coverage-reports