-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[COMPILETEST-UNTANGLE 6/N] Use TestSuite
enum instead of stringly-typed test suites
#143870
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
base: master
Are you sure you want to change the base?
Conversation
They do not have sensible defaults, and it is crucial that we get them right.
It is *critical* that we maintain clear nomenclature in `compiletest`. We have many types of "modes" in `compiletest` -- pass modes, coverage modes, compare modes, you name it. `Mode` is also a *super* general term. Rename it to `TestMode` to leave no room for such ambiguity. As a follow-up, I also intend to introduce an enum for `TestSuite`, then rid of all usage of glob re-exported `TestMode::*` enum variants -- many test suites share the same name as the test mode.
I would like to introduce `TestSuite` over stringly-typed test suite names, and some test suite names are the same as test modes, which can make this very confusing.
@@ -869,7 +867,6 @@ const COMPILETEST_DIRECTIVE_PREFIX: &str = "//@"; | |||
|
|||
fn iter_directives( | |||
mode: TestMode, | |||
_suite: &str, |
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: removed as this is (at the moment) unused.
// Note that coverage tests use the same test files for multiple test modes. | ||
string_enum! { | ||
#[derive(Clone, Copy, PartialEq, Debug)] | ||
pub enum TestSuite { | ||
Assembly => "assembly", | ||
Codegen => "codegen", | ||
CodegenUnits => "codegen-units", | ||
Coverage => "coverage", | ||
CoverageRunRustdoc => "coverage-run-rustdoc", | ||
Crashes => "crashes", | ||
Debuginfo => "debuginfo", | ||
Incremental => "incremental", | ||
MirOpt => "mir-opt", | ||
Pretty => "pretty", | ||
RunMake => "run-make", | ||
Rustdoc => "rustdoc", | ||
RustdocGui => "rustdoc-gui", | ||
RustdocJs => "rustdoc-js", | ||
RustdocJsStd=> "rustdoc-js-std", | ||
RustdocJson => "rustdoc-json", | ||
RustdocUi => "rustdoc-ui", | ||
Ui => "ui", | ||
UiFullDeps => "ui-fulldeps", | ||
} | ||
} |
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: probably will want to share this definition in the future with bootstrap, but strive for compiletest-internal self-consistency first (à la #135653, but don't want to do that yet to make compiletest refactorings less annoying).
Looks simple enough, and a nice cleanup. |
r? @Kobzol |
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #143867) made this pull request unmergeable. Please resolve the merge conflicts. |
Caution
Stacked on top of #143823.
This is part of a patch series to untangle
compiletest
to hopefully nudge it towards being more maintainable.This PR should contain no functional changes.