From fcd3279f36214e6915a3b14074f154da3c7cd88a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 6 Sep 2016 20:36:14 +0000 Subject: [PATCH] Improve bootstrap crate testing for emscripten --- src/bootstrap/check.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index c839e4053532..0bd9355098f2 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -385,8 +385,19 @@ fn krate_emscripten(build: &Build, for test in tests { let test_file_name = test.to_string_lossy().into_owned(); - let output = output(Command::new("node").arg(&test_file_name)); - println!("{}", output); + println!("running {}", test_file_name); + let output = Command::new("node") + .arg(&test_file_name) + .stderr(::std::process::Stdio::inherit()) + .output(); + let output = match output { + Ok(status) => status, + Err(e) => panic!(format!("failed to execute command: {}", e)), + }; + println!("{}", String::from_utf8(output.stdout).unwrap()); + if !output.status.success() { + panic!("some tests failed"); + } } } @@ -402,7 +413,7 @@ fn find_tests(dir: &Path, let filename = e.file_name().into_string().unwrap(); if (target.contains("windows") && filename.ends_with(".exe")) || (!target.contains("windows") && !filename.contains(".")) || - (target.contains("asmjs") && filename.contains(".js")){ + (target.contains("emscripten") && filename.contains(".js")){ dst.push(e.path()); } }