-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Break up compiletest runtest.rs
into smaller helper modules
#130566
Conversation
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.
This PR might want to get its git rev ignored as it does a lot of moving.
@@ -18,7 +18,7 @@ impl<'test> TestCx<'test> { | |||
.unwrap_or_else(|| self.fatal("missing --coverage-dump")) | |||
} | |||
|
|||
pub(crate) fn run_coverage_map_test(&self) { | |||
pub(super) fn run_coverage_map_test(&self) { |
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.
Remark: changed visibility from pub(crate)
-> pub(super)
for consistency as it does not need to be visible outside of runtest.rs
.
// FIXME(jieyouxu): `run_rpass_test` got hoisted out of this because apparently valgrind falls back | ||
// to `run_rpass_test` if valgrind isn't available, which is questionable, but keeping it for | ||
// refactoring changes to preserve current behavior. |
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.
Remark: FIXME because valgrind just runs rpass if valgrind isn't available, which is highly questionable.
// FIXME(jieyouxu): does this really make any sense? If a valgrind test isn't testing | ||
// valgrind, what is it even testing? | ||
if self.config.valgrind_path.is_none() { | ||
assert!(!self.config.force_valgrind); | ||
return self.run_rpass_test(); | ||
} |
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.
Remark: this is sus
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.
Remark: I know this file is still really messy, further changes planned in future PRs.
Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This commit intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR.
9eccfc1
to
60600a6
Compare
This should now be ready for review. |
Would appreciate feedback if this organization makes sense, or if there's a better way to organize it. (And feel free to reroll :3) |
@bors r+ |
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#129542 (Add regression test for rust-lang#129541) - rust-lang#129755 (test: cross-edition metavar fragment specifiers) - rust-lang#130566 (Break up compiletest `runtest.rs` into smaller helper modules) - rust-lang#130585 (Add tidy check for rustdoc templates to ensure the whitespace characters are all stripped) - rust-lang#130605 (Fix feature name in test) - rust-lang#130607 ([Clippy] Remove final std paths for diagnostic item) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130566 - jieyouxu:breakup-runtest, r=compiler-errors Break up compiletest `runtest.rs` into smaller helper modules Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This PR breaks the `runtest.rs` file up into smaller helper modules, one for each test suite/mode. > [!NOTE] > This PR should not contain functional changes, it is intended to be mostly code motion to breakup `runtest.rs` into smaller helper modules to make it easier to digest. > > This PR intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR. Some methods on `TestCx` do not need to be on `TestCx`. It also does not address a weirdness in valgrind, that is intended for a follow-up PR as well. Part of a series of compiletest cleanups rust-lang#130565. Fixes rust-lang#89475. r? `@ghost` (I need to do a self-review pass first)
Previously compiletest's
runtest.rs
was a massive 4700 lines file that made reading and navigation very awkward. This PR breaks theruntest.rs
file up into smaller helper modules, one for each test suite/mode.Note
This PR should not contain functional changes, it is intended to be mostly code motion to breakup
runtest.rs
into smaller helper modules to make it easier to digest.This PR intentionally does not neatly reorganize where all the methods on
TestCx
goes, that is intended for a follow-up PR. Some methods onTestCx
do not need to be onTestCx
. It also does not address a weirdness in valgrind, that is intended for a follow-up PR as well.Part of a series of compiletest cleanups #130565.
Fixes #89475.
r? @ghost (I need to do a self-review pass first)