Only run rustdoc-js test suite when nodejs is available

This commit is contained in:
Guillaume Gomez 2018-01-13 22:35:41 +01:00
parent 69521996c8
commit 026c749989

View file

@ -447,14 +447,17 @@ impl Step for RustdocJS {
}
fn run(self, builder: &Builder) {
let nodejs = builder.config.nodejs.clone();
let mut command = Command::new(&nodejs.expect("no nodejs found"));
command.args(&["src/tools/rustdoc-js/tester.js", &*self.host]);
builder.ensure(::doc::Std {
target: self.target,
stage: builder.top_stage,
});
builder.run(&mut command);
if let Some(ref nodejs) = builder.config.nodejs {
let mut command = Command::new(nodejs);
command.args(&["src/tools/rustdoc-js/tester.js", &*self.host]);
builder.ensure(::doc::Std {
target: self.target,
stage: builder.top_stage,
});
builder.run(&mut command);
} else {
println!("No nodejs found, skipping \"src/test/rustdoc-js\" tests");
}
}
}