Skip to content

Commit

Permalink
Skip testing targets that don't ship libstd
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Nov 30, 2018
1 parent 8d2bc97 commit f7e2ca8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir:
return;
}

let target_lib_dir = sysroot.join("lib").join("rustlib").join(target).join("lib");
let has_std = std::fs::read_dir(target_lib_dir)
.expect("invalid target")
.map(|entry| entry.unwrap())
.filter(|entry| entry.file_type().unwrap().is_file())
.filter_map(|entry| entry.file_name().into_string().ok())
.any(|file_name| file_name.starts_with("libstd") && file_name.ends_with(".rlib"));

if !has_std {
eprintln!("{}\n", format!(
"## Skipping run-pass tests in {} against miri for target {} due to missing libstd",
path,
target
).yellow().bold());
return;
}

let opt_str = if opt { " with optimizations" } else { "" };
eprintln!("{}", format!(
"## Running run-pass tests in {} against miri for target {}{}",
Expand Down

0 comments on commit f7e2ca8

Please sign in to comment.