]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass-fulldeps/issue-15149.rs
rustc: Load the `rustc_trans` crate at runtime
[rust.git] / src / test / run-pass-fulldeps / issue-15149.rs
index 121fd4a9825df0d3770b66ed3db7a1da5a468bf8..15ac1d55cc8c41a2164112f0f917eac8dff55bda 100644 (file)
 // no-prefer-dynamic
 // ignore-cross-compile
 
-#![feature(rustc_private)]
-
-extern crate tempdir;
-
 use std::env;
 use std::fs;
 use std::process;
 use std::str;
-use tempdir::TempDir;
+use std::path::PathBuf;
 
 fn main() {
     // If we're the child, make sure we were invoked correctly
@@ -41,8 +37,9 @@ fn test() {
     let my_path = env::current_exe().unwrap();
     let my_dir  = my_path.parent().unwrap();
 
-    let child_dir = TempDir::new_in(&my_dir, "issue-15140-child").unwrap();
-    let child_dir = child_dir.path();
+    let child_dir = PathBuf::from(env::var_os("RUST_TEST_TMPDIR").unwrap());
+    let child_dir = child_dir.join("issue-15140-child");
+    fs::create_dir_all(&child_dir).unwrap();
 
     let child_path = child_dir.join(&format!("mytest{}",
                                              env::consts::EXE_SUFFIX));
@@ -63,11 +60,4 @@ fn test() {
             format!("child assertion failed\n child stdout:\n {}\n child stderr:\n {}",
                     str::from_utf8(&child_output.stdout).unwrap(),
                     str::from_utf8(&child_output.stderr).unwrap()));
-
-    let res = fs::remove_dir_all(&child_dir);
-    if res.is_err() {
-        // On Windows deleting just executed mytest.exe can fail because it's still locked
-        std::thread::sleep_ms(1000);
-        fs::remove_dir_all(&child_dir).unwrap();
-    }
 }