diff options
| author | Ross Schulman <ross@rbs.io> | 2016-09-05 19:56:48 -0400 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2016-09-30 14:02:43 -0700 |
| commit | ad9184c9bfd47e1be43726c7f68fa8a4f879cb94 (patch) | |
| tree | 73572a73a3cfe9a9cf8c6c4535aa3650969471ac | |
| parent | c62d8b12bf68ea09a9a588b58da89e7925de21b1 (diff) | |
| download | rust-ad9184c9bfd47e1be43726c7f68fa8a4f879cb94.tar.gz rust-ad9184c9bfd47e1be43726c7f68fa8a4f879cb94.zip | |
Adapting bootstrap to run tests on asmjs.
| -rw-r--r-- | src/bootstrap/check.rs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 2b9d717cbd4..8a844f71031 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -323,6 +323,9 @@ pub fn krate(build: &Build, if target.contains("android") { build.run(cargo.arg("--no-run")); krate_android(build, compiler, target, mode); + } else if target.contains("asmjs") { + build.run(cargo.arg("--no-run")); + krate_asmjs(build, compiler, target, mode); } else { cargo.args(&build.flags.args); build.run(&mut cargo); @@ -371,6 +374,23 @@ fn krate_android(build: &Build, } } +fn krate_asmjs(build: &Build, + compiler: &Compiler, + target: &str, + mode: Mode) { + let mut tests = Vec::new(); + let out_dir = build.cargo_out(compiler, mode, target); + find_tests(&out_dir, target, &mut tests); + find_tests(&out_dir.join("deps"), target, &mut tests); + + 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); + } + } + + fn find_tests(dir: &Path, target: &str, dst: &mut Vec<PathBuf>) { @@ -381,7 +401,8 @@ 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("windows") && !filename.contains(".")) || + (target.contains("asmjs") && filename.contains(".js")){ dst.push(e.path()); } } |
