Skip to content

Commit 50bb6ba

Browse files
Move forward to add rustdoc test
1 parent 43acd23 commit 50bb6ba

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

src/bootstrap/builder.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ impl<'a> Builder<'a> {
254254
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest,
255255
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Rustdoc,
256256
check::Linkcheck, check::Cargotest, check::Cargo, check::Rls, check::Docs,
257-
check::ErrorIndex, check::Distcheck, check::Rustfmt, check::Miri, check::Clippy),
257+
check::ErrorIndex, check::Distcheck, check::Rustfmt, check::Miri, check::Clippy,
258+
check::RustdocJS),
259+
258260
Kind::Bench => describe!(check::Crate, check::CrateLibrustc),
259261
Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook,
260262
doc::Standalone, doc::Std, doc::Test, doc::Rustc, doc::ErrorIndex, doc::Nomicon,

src/bootstrap/check.rs

+7-14
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,12 @@ pub struct RustdocJS {
430430
}
431431

432432
impl Step for RustdocJS {
433-
type Output = PathBuf;
433+
type Output = ();
434434
const DEFAULT: bool = true;
435435
const ONLY_HOSTS: bool = true;
436436

437437
fn should_run(run: ShouldRun) -> ShouldRun {
438-
run.path("node")
438+
run.path("src/tests/rustdoc-js")
439439
}
440440

441441
fn make_run(run: RunConfig) {
@@ -444,17 +444,11 @@ impl Step for RustdocJS {
444444
});
445445
}
446446

447-
fn run(self, _: &Builder) {
448-
let cmd = if cfg!(target_os = "windows") {
449-
let command = Command::new("cmd");
450-
command.args(&["/C", "node src/tools/rustdoc-js/tester.js"]);
451-
command
452-
} else {
453-
let command = Command::new("sh");
454-
command.args(&["-c", "node src/tools/rustdoc-js/tester.js"]);
455-
command
456-
};
457-
builder.run(cmd);
447+
fn run(self, builder: &Builder) {
448+
let nodejs = builder.config.nodejs.clone();
449+
let mut command = Command::new(&nodejs.expect("no nodejs found"));
450+
command.args(&["src/tools/rustdoc-js/tester.js", &*self.host]);
451+
builder.run(&mut command);
458452
}
459453
}
460454

@@ -604,7 +598,6 @@ static HOST_COMPILETESTS: &[Test] = &[
604598
},
605599
Test { path: "src/test/run-make", mode: "run-make", suite: "run-make" },
606600
Test { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" },
607-
Test { path: "src/test/rustdoc-js", mode: "rustdoc-js", suite: "rustdoc-js" },
608601

609602
Test { path: "src/test/pretty", mode: "pretty", suite: "pretty" },
610603
Test { path: "src/test/run-pass/pretty", mode: "pretty", suite: "run-pass" },

src/bootstrap/tool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ tool!(
260260
BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Libstd;
261261
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::Libstd;
262262
RustInstaller, "src/tools/rust-installer", "fabricate", Mode::Libstd;
263-
RustdocJS, "node", "node", Mode::Tool;
263+
RustdocJS, "rustdoc-js", "js-tests", Mode::Tool;
264264
);
265265

266266
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]

0 commit comments

Comments
 (0)