From 35c76c68627cdd761d53ea6c7cb17e09e705dbf9 Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Fri, 17 Jun 2016 21:06:20 -0600 Subject: [PATCH] Ignore non-Rust files in run-pass. Specifically, Vim's ..swp files were being run as tests. --- tests/compiletest.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 66b94ad88da5..2f503f7a8110 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -52,20 +52,23 @@ fn compile_test() { for_all_targets(&sysroot, |target| { for file in std::fs::read_dir("tests/run-pass").unwrap() { let file = file.unwrap(); - if !file.metadata().unwrap().is_file() { + let path = file.path(); + + if !file.metadata().unwrap().is_file() || !path.to_str().unwrap().ends_with(".rs") { continue; } - let file = file.path(); + let stderr = std::io::stderr(); - write!(stderr.lock(), "test [miri-pass] {} ", file.to_str().unwrap()).unwrap(); + write!(stderr.lock(), "test [miri-pass] {} ... ", path.display()).unwrap(); let mut cmd = std::process::Command::new("target/debug/miri"); - cmd.arg(file); + cmd.arg(path); cmd.arg("-Dwarnings"); cmd.arg(format!("--target={}", target)); let libs = Path::new(&sysroot).join("lib"); let sysroot = libs.join("rustlib").join(&target).join("lib"); let paths = std::env::join_paths(&[libs, sysroot]).unwrap(); cmd.env(compiletest::procsrv::dylib_env_var(), paths); + match cmd.output() { Ok(ref output) if output.status.success() => writeln!(stderr.lock(), "ok").unwrap(), Ok(output) => {