@@ -53,6 +53,32 @@ impl TestMode {
5353 }
5454}
5555
56+ // Note that coverage tests use the same test files for multiple test modes.
57+ string_enum ! {
58+ #[ derive( Clone , Copy , PartialEq , Debug ) ]
59+ pub enum TestSuite {
60+ Assembly => "assembly" ,
61+ Codegen => "codegen" ,
62+ CodegenUnits => "codegen-units" ,
63+ Coverage => "coverage" ,
64+ CoverageRunRustdoc => "coverage-run-rustdoc" ,
65+ Crashes => "crashes" ,
66+ Debuginfo => "debuginfo" ,
67+ Incremental => "incremental" ,
68+ MirOpt => "mir-opt" ,
69+ Pretty => "pretty" ,
70+ RunMake => "run-make" ,
71+ Rustdoc => "rustdoc" ,
72+ RustdocGui => "rustdoc-gui" ,
73+ RustdocJs => "rustdoc-js" ,
74+ RustdocJsStd => "rustdoc-js-std" ,
75+ RustdocJson => "rustdoc-json" ,
76+ RustdocUi => "rustdoc-ui" ,
77+ Ui => "ui" ,
78+ UiFullDeps => "ui-fulldeps" ,
79+ }
80+ }
81+
5682string_enum ! {
5783 #[ derive( Clone , Copy , PartialEq , Debug , Hash ) ]
5884 pub enum PassMode {
@@ -276,15 +302,13 @@ pub struct Config {
276302
277303 /// The test suite.
278304 ///
279- /// Example: `tests/ui/` is the "UI" test *suite*, which happens to also be of the
305+ /// Example: `tests/ui/` is [`TestSuite::Ui`] test *suite*, which happens to also be of the
280306 /// [`TestMode::Ui`] test *mode*.
281307 ///
282- /// Note that the same test directory (e.g. `tests/coverage/`) may correspond to multiple test
308+ /// Note that the same test suite (e.g. `tests/coverage/`) may correspond to multiple test
283309 /// modes, e.g. `tests/coverage/` can be run under both [`TestMode::CoverageRun`] and
284310 /// [`TestMode::CoverageMap`].
285- ///
286- /// FIXME: stop using stringly-typed test suites!
287- pub suite : String ,
311+ pub suite : TestSuite ,
288312
289313 /// When specified, **only** the specified [`Debugger`] will be used to run against the
290314 /// `tests/debuginfo` test suite. When unspecified, `compiletest` will attempt to find all three
@@ -537,8 +561,8 @@ pub struct Config {
537561 // Configuration for various run-make tests frobbing things like C compilers or querying about
538562 // various LLVM component information.
539563 //
540- // FIXME: this really should be better packaged together. FIXME: these need better docs, e.g.
541- // for *host*, or for *target*?
564+ // FIXME: this really should be better packaged together.
565+ // FIXME: these need better docs, e.g. for *host*, or for *target*?
542566 pub cc : String ,
543567 pub cxx : String ,
544568 pub cflags : String ,
@@ -617,6 +641,8 @@ impl Config {
617641 // For instance, `//@ ignore-stage1` will not work at all.
618642 Config {
619643 mode : TestMode :: Rustdoc ,
644+ // E.g. this has no sensible default tbh.
645+ suite : TestSuite :: Ui ,
620646
621647 // Dummy values.
622648 edition : Default :: default ( ) ,
@@ -642,7 +668,6 @@ impl Config {
642668 sysroot_base : Utf8PathBuf :: default ( ) ,
643669 stage : Default :: default ( ) ,
644670 stage_id : String :: default ( ) ,
645- suite : Default :: default ( ) ,
646671 debugger : Default :: default ( ) ,
647672 run_ignored : Default :: default ( ) ,
648673 with_rustc_debug_assertions : Default :: default ( ) ,
0 commit comments