diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 7aa55ef663..d52e492b52 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -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 {}{}",