@@ -53,6 +53,32 @@ impl TestMode {
53
53
}
54
54
}
55
55
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
+
56
82
string_enum ! {
57
83
#[ derive( Clone , Copy , PartialEq , Debug , Hash ) ]
58
84
pub enum PassMode {
@@ -276,15 +302,13 @@ pub struct Config {
276
302
277
303
/// The test suite.
278
304
///
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
280
306
/// [`TestMode::Ui`] test *mode*.
281
307
///
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
283
309
/// modes, e.g. `tests/coverage/` can be run under both [`TestMode::CoverageRun`] and
284
310
/// [`TestMode::CoverageMap`].
285
- ///
286
- /// FIXME: stop using stringly-typed test suites!
287
- pub suite : String ,
311
+ pub suite : TestSuite ,
288
312
289
313
/// When specified, **only** the specified [`Debugger`] will be used to run against the
290
314
/// `tests/debuginfo` test suite. When unspecified, `compiletest` will attempt to find all three
@@ -537,8 +561,8 @@ pub struct Config {
537
561
// Configuration for various run-make tests frobbing things like C compilers or querying about
538
562
// various LLVM component information.
539
563
//
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*?
542
566
pub cc : String ,
543
567
pub cxx : String ,
544
568
pub cflags : String ,
@@ -617,6 +641,8 @@ impl Config {
617
641
// For instance, `//@ ignore-stage1` will not work at all.
618
642
Config {
619
643
mode : TestMode :: Rustdoc ,
644
+ // E.g. this has no sensible default tbh.
645
+ suite : TestSuite :: Ui ,
620
646
621
647
// Dummy values.
622
648
edition : Default :: default ( ) ,
@@ -642,7 +668,6 @@ impl Config {
642
668
sysroot_base : Utf8PathBuf :: default ( ) ,
643
669
stage : Default :: default ( ) ,
644
670
stage_id : String :: default ( ) ,
645
- suite : Default :: default ( ) ,
646
671
debugger : Default :: default ( ) ,
647
672
run_ignored : Default :: default ( ) ,
648
673
with_rustc_debug_assertions : Default :: default ( ) ,
0 commit comments