提交 8401e374 编写于 作者: B Brian Anderson

Update bootstrap and compiletest to use the detected nodejs

上级 a4c32881
......@@ -108,6 +108,10 @@ pub fn compiletest(build: &Build,
cmd.arg("--host").arg(compiler.host);
cmd.arg("--llvm-filecheck").arg(build.llvm_filecheck(&build.config.build));
if let Some(nodejs) = build.config.nodejs.as_ref() {
cmd.arg("--nodejs").arg(nodejs);
}
let mut flags = vec!["-Crpath".to_string()];
if build.config.rust_optimize_tests {
flags.push("-O".to_string());
......@@ -386,7 +390,8 @@ fn krate_emscripten(build: &Build,
for test in tests {
let test_file_name = test.to_string_lossy().into_owned();
println!("running {}", test_file_name);
let output = Command::new("node")
let nodejs = build.config.nodejs.as_ref().expect("nodejs not configured");
let output = Command::new(nodejs)
.arg(&test_file_name)
.stderr(::std::process::Stdio::inherit())
.output();
......
......@@ -183,4 +183,5 @@ pub struct Config {
pub cflags: String,
pub llvm_components: String,
pub llvm_cxxflags: String,
pub nodejs: Option<String>,
}
......@@ -109,6 +109,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
reqopt("", "cflags", "flags for the C compiler", "FLAGS"),
reqopt("", "llvm-components", "list of LLVM components built in", "LIST"),
reqopt("", "llvm-cxxflags", "C++ flags for LLVM", "FLAGS"),
optopt("", "nodejs", "the name of nodejs", "PATH"),
optflag("h", "help", "show this message"));
let (argv0, args_) = args.split_first().unwrap();
......@@ -190,6 +191,7 @@ fn make_absolute(path: PathBuf) -> PathBuf {
cflags: matches.opt_str("cflags").unwrap(),
llvm_components: matches.opt_str("llvm-components").unwrap(),
llvm_cxxflags: matches.opt_str("llvm-cxxflags").unwrap(),
nodejs: matches.opt_str("nodejs"),
}
}
......
......@@ -1439,7 +1439,8 @@ fn make_run_args(&self) -> ProcArgs {
// If this is emscripten, then run tests under nodejs
if self.config.target.contains("emscripten") {
args.push("node".to_owned());
let nodejs = self.config.nodejs.clone().unwrap_or("nodejs".to_string());
args.push(nodejs);
}
let exe_file = self.make_exe_name();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册