]> git.lizzy.rs Git - rust.git/commitdiff
Update bootstrap and compiletest to use the detected nodejs
authorBrian Anderson <banderson@mozilla.com>
Thu, 15 Sep 2016 19:42:26 +0000 (19:42 +0000)
committerBrian Anderson <banderson@mozilla.com>
Fri, 30 Sep 2016 21:02:53 +0000 (14:02 -0700)
src/bootstrap/check.rs
src/tools/compiletest/src/common.rs
src/tools/compiletest/src/main.rs
src/tools/compiletest/src/runtest.rs

index 0bd9355098f26df9a25680c38d5d7bd1922168b9..95c909aef773c111a729a29a8afcce2e0afd7b4f 100644 (file)
@@ -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();
index 5d522736089ea4d2acf1340b99bf5a6cd6c23583..81cb927f26b0210d33ff07695a281f424ba70142 100644 (file)
@@ -183,4 +183,5 @@ pub struct Config {
     pub cflags: String,
     pub llvm_components: String,
     pub llvm_cxxflags: String,
+    pub nodejs: Option<String>,
 }
index 6e92a32cfeb67e532338e3553201d1591ebfb32f..ff91ab7c70b3ee97a05f96c7e93e3033c3554b51 100644 (file)
@@ -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"),
     }
 }
 
index 5885e464b4f14043992970bec8358d68a55ecf03..35b93392baf2c4c96110e961a7a871f714394a01 100644 (file)
@@ -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();