Skip to content

Commit 8946bf5

Browse files
authored
Rollup merge of rust-lang#118322 - onur-ozkan:if-only-doctests-skip-compiletest, r=clubby789
skip {tidy,compiletest,rustdoc-gui} based tests for `DocTests::Only` As use of `--doc` with `x test` is intended for running doc-tests only, executing compiletest, tidy or rustdoc-gui based tests considered as an incorrect behavior from bootstrap. This change fixes that.
2 parents 601a427 + 1a86482 commit 8946bf5

File tree

1 file changed

+9
-1
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+9
-1
lines changed

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,7 @@ impl Step for RustdocGUI {
999999
let run = run.suite_path("tests/rustdoc-gui");
10001000
run.lazy_default_condition(Box::new(move || {
10011001
builder.config.nodejs.is_some()
1002+
&& builder.doc_tests != DocTests::Only
10021003
&& builder
10031004
.config
10041005
.npm
@@ -1158,7 +1159,8 @@ HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to
11581159
}
11591160

11601161
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1161-
run.path("src/tools/tidy")
1162+
let default = run.builder.doc_tests != DocTests::Only;
1163+
run.path("src/tools/tidy").default_condition(default)
11621164
}
11631165

11641166
fn make_run(run: RunConfig<'_>) {
@@ -1560,6 +1562,10 @@ impl Step for Compiletest {
15601562
/// compiletest `mode` and `suite` arguments. For example `mode` can be
15611563
/// "run-pass" or `suite` can be something like `debuginfo`.
15621564
fn run(self, builder: &Builder<'_>) {
1565+
if builder.doc_tests == DocTests::Only {
1566+
return;
1567+
}
1568+
15631569
if builder.top_stage == 0 && env::var("COMPILETEST_FORCE_STAGE0").is_err() {
15641570
eprintln!("\
15651571
ERROR: `--stage 0` runs compiletest on the beta compiler, not your local changes, and will almost always cause tests to fail
@@ -2323,6 +2329,8 @@ impl Step for CrateLibrustc {
23232329
}
23242330

23252331
fn run(self, builder: &Builder<'_>) {
2332+
builder.ensure(compile::Std::new(self.compiler, self.target));
2333+
23262334
builder.ensure(Crate {
23272335
compiler: self.compiler,
23282336
target: self.target,

0 commit comments

Comments
 (0)