From 49dfd82fd363a6379af9a6c453e2217e58a0fc6d Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 31 May 2016 16:41:26 +0200 Subject: [PATCH] fallout because compiletest tried to use rustc's log crate --- tests/run-fail/inception.rs | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/tests/run-fail/inception.rs b/tests/run-fail/inception.rs index 25eb72aa04c..f0fb4113f1f 100644 --- a/tests/run-fail/inception.rs +++ b/tests/run-fail/inception.rs @@ -9,14 +9,32 @@ fn run_miri(file: &str, sysroot: &str) -> Output { let libpath = libpath.to_str().unwrap(); let libpath2 = path.join("target").join("debug").join("deps"); let libpath2 = libpath2.to_str().unwrap(); + let mut args = vec![ + "run".to_string(), "--".to_string(), + "--sysroot".to_string(), sysroot.to_string(), + "-L".to_string(), libpath.to_string(), + "-L".to_string(), libpath2.to_string(), + file.to_string() + ]; + for file in std::fs::read_dir("target/debug/deps").unwrap() { + let file = file.unwrap(); + if file.file_type().unwrap().is_file() { + let path = file.path(); + if let Some(ext) = path.extension() { + if ext == "rlib" { + let name = path.file_stem().unwrap().to_str().unwrap(); + if let Some(dash) = name.rfind('-') { + if name.starts_with("lib") { + args.push("--extern".to_string()); + args.push(format!("{}={}", &name[3..dash], path.to_str().unwrap())); + } + } + } + } + } + } Command::new("cargo") - .args(&[ - "run", "--", - "--sysroot", sysroot, - "-L", libpath, - "-L", libpath2, - file - ]) + .args(&args) .output() .unwrap_or_else(|e| panic!("failed to execute process: {}", e)) } -- 2.44.0