diff options
| author | Pietro Albini <pietro.albini@ferrous-systems.com> | 2023-06-06 11:55:02 +0200 |
|---|---|---|
| committer | Pietro Albini <pietro.albini@ferrous-systems.com> | 2023-06-12 09:32:36 +0200 |
| commit | 1b5143ae13c50aeb3d8a84d838e4db54a57e8a5b (patch) | |
| tree | 74e7c12d356bcd75933b00ee07a7c70233176442 | |
| parent | 77dba225c1048e5585b2cdefb7f8588bd2d2741b (diff) | |
| download | rust-1b5143ae13c50aeb3d8a84d838e4db54a57e8a5b.tar.gz rust-1b5143ae13c50aeb3d8a84d838e4db54a57e8a5b.zip | |
stop using a macro for the mir-opt test suite
| -rw-r--r-- | src/bootstrap/test.rs | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index f31ba946099..699b7f0be85 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1261,8 +1261,6 @@ default_test!(RunPassValgrind { suite: "run-pass-valgrind" }); -default_test!(MirOpt { path: "tests/mir-opt", mode: "mir-opt", suite: "mir-opt" }); - default_test!(Codegen { path: "tests/codegen", mode: "codegen", suite: "codegen" }); default_test!(CodegenUnits { @@ -1299,6 +1297,39 @@ host_test!(RunMakeFullDeps { default_test!(Assembly { path: "tests/assembly", mode: "assembly", suite: "assembly" }); +// For the mir-opt suite we do not use macros, as we need custom behavior when blessing. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct MirOpt { + pub compiler: Compiler, + pub target: TargetSelection, +} + +impl Step for MirOpt { + type Output = (); + const DEFAULT: bool = true; + const ONLY_HOSTS: bool = false; + + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { + run.suite_path("tests/mir-opt") + } + + fn make_run(run: RunConfig<'_>) { + let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple()); + run.builder.ensure(MirOpt { compiler, target: run.target }); + } + + fn run(self, builder: &Builder<'_>) { + builder.ensure(Compiletest { + compiler: self.compiler, + target: self.target, + mode: "mir-opt", + suite: "mir-opt", + path: "tests/mir-opt", + compare_mode: None, + }); + } +} + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] struct Compiletest { compiler: Compiler, |
