Skip to content

Commit 4a44164

Browse files
committed
Move CrateBuildHelper into bootstrap_self_tests
1 parent d4f534f commit 4a44164

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

src/bootstrap/src/core/build_steps/test/bootstrap_self_tests.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,40 @@ impl Step for Bootstrap {
135135
run_cargo_test(cargo, &["--test-threads=1"], &[], "bootstrap", None, host, builder);
136136
}
137137
}
138+
139+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
140+
pub struct CrateBuildHelper {
141+
host: TargetSelection,
142+
}
143+
144+
impl Step for CrateBuildHelper {
145+
type Output = ();
146+
const ONLY_HOSTS: bool = true;
147+
148+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
149+
run.path("src/build_helper")
150+
}
151+
152+
fn make_run(run: RunConfig<'_>) {
153+
run.builder.ensure(CrateBuildHelper { host: run.target });
154+
}
155+
156+
/// Runs `cargo test` for build_helper.
157+
fn run(self, builder: &Builder<'_>) {
158+
let host = self.host;
159+
let compiler = builder.compiler(0, host);
160+
161+
let mut cargo = tool::prepare_tool_cargo(
162+
builder,
163+
compiler,
164+
Mode::ToolBootstrap,
165+
host,
166+
Kind::Test,
167+
"src/build_helper",
168+
SourceType::InTree,
169+
&[],
170+
);
171+
cargo.allow_features("test");
172+
run_cargo_test(cargo, &[], &[], "build_helper", "build_helper self test", host, builder);
173+
}
174+
}

src/bootstrap/src/core/build_steps/test/mod.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -70,43 +70,6 @@ pub(crate) use std_tests::TestFloatParse;
7070
pub(crate) use test_helpers::Crate;
7171
pub(crate) use tidy::Tidy;
7272

73-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
74-
pub struct CrateBuildHelper {
75-
host: TargetSelection,
76-
}
77-
78-
impl Step for CrateBuildHelper {
79-
type Output = ();
80-
const ONLY_HOSTS: bool = true;
81-
82-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
83-
run.path("src/build_helper")
84-
}
85-
86-
fn make_run(run: RunConfig<'_>) {
87-
run.builder.ensure(CrateBuildHelper { host: run.target });
88-
}
89-
90-
/// Runs `cargo test` for build_helper.
91-
fn run(self, builder: &Builder<'_>) {
92-
let host = self.host;
93-
let compiler = builder.compiler(0, host);
94-
95-
let mut cargo = tool::prepare_tool_cargo(
96-
builder,
97-
compiler,
98-
Mode::ToolBootstrap,
99-
host,
100-
Kind::Test,
101-
"src/build_helper",
102-
SourceType::InTree,
103-
&[],
104-
);
105-
cargo.allow_features("test");
106-
run_cargo_test(cargo, &[], &[], "build_helper", "build_helper self test", host, builder);
107-
}
108-
}
109-
11073
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
11174
pub struct Distcheck;
11275

0 commit comments

Comments
 (0)