Skip to content

Commit

Permalink
clean up code related to the rustdoc-js test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
lolbinarycat committed Jan 11, 2025
1 parent 251206c commit 0962afa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use crate::utils::render_tests::{add_flags_and_try_run_tests, try_run_tests};
use crate::{CLang, DocTests, GitRepo, Mode, PathSet, envify};

const ADB_TEST_DIR: &str = "/data/local/tmp/work";
const RUSTDOC_JS: &str = "rustdoc-js";

/// Runs `cargo test` on various internal tools used by bootstrap.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
Expand Down Expand Up @@ -914,8 +915,8 @@ impl Step for RustdocJSNotStd {
builder.ensure(Compiletest {
compiler: self.compiler,
target: self.target,
mode: "js-doc-test",
suite: "rustdoc-js",
mode: RUSTDOC_JS,
suite: RUSTDOC_JS,
path: "tests/rustdoc-js",
compare_mode: None,
});
Expand Down Expand Up @@ -1726,7 +1727,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
cmd.arg("--minicore-path")
.arg(builder.src.join("tests").join("auxiliary").join("minicore.rs"));

let is_rustdoc = suite.ends_with("rustdoc-ui") || suite.ends_with("rustdoc-js");
let is_rustdoc = suite == "rustdoc-ui" || suite == RUSTDOC_JS;

if mode == "run-make" {
let cargo_path = if builder.top_stage == 0 {
Expand Down Expand Up @@ -1754,7 +1755,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
if mode == "rustdoc"
|| mode == "run-make"
|| (mode == "ui" && is_rustdoc)
|| mode == "js-doc-test"
|| mode == RUSTDOC_JS
|| mode == "rustdoc-json"
|| suite == "coverage-run-rustdoc"
{
Expand Down Expand Up @@ -1826,8 +1827,8 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the

if let Some(ref nodejs) = builder.config.nodejs {
cmd.arg("--nodejs").arg(nodejs);
} else if mode == "js-doc-test" {
panic!("need nodejs to run js-doc-test suite");
} else if mode == RUSTDOC_JS {
panic!("need nodejs to run rustdoc-js suite");
}
if let Some(ref npm) = builder.config.npm {
cmd.arg("--npm").arg(npm);
Expand Down

0 comments on commit 0962afa

Please sign in to comment.