Skip to content

Splitting up compiletest::runtest #89475

Closed
@Nicholas-Baron

Description

@Nicholas-Baron

Subtask to #60302.

  • RunPassValgrind is practically useless (valgrind is not installed on CI, and the tests are just run in run-pass mode). The right approach here is likely to refactor it as a modifier atop the regular run-pass tests -- it looks like the code generally just mirrors the RunPass mode, other than setting the runtool to valgrind. That mode can be enabled in the configuration of the test with // use-valgrind or something like that.
  • Move diff computation out into a separate module (DiffLine, Mismatch, make_diff, ...)
  • Move read2_abbreviated to the read2.rs module
  • Move DebuggerCommands and their parsing out to a separate file, alongside check_debugger_output (which is similarly parsing code).

I suspect this set of changes is likely harder, and might not get to <3000 lines; there's likely more cleanup work possible, though. This module has grown pretty organically over the last ~10 years -- there's a lot of small bits that can be adjusted to make things better. There's probably also subtle inconsistencies between various functions that would likely be nice to clean up and unify, and filing PRs for those would be helpful -- likely some care is needed, perhaps even some small test updates, but overall a good goal.

You might also be interested in #40713, as a somewhat larger project.

Originally posted by @Mark-Simulacrum in #89240 (comment)

Metadata

Metadata

Assignees

Labels

A-compiletestArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions