$OpenBSD: patch-tests_cargotest_support_paths_rs,v 1.4 2017/02/15 12:49:43 landry Exp $
use MODCARGO_TARGET_DIR as temporary directory for testing.
--- tests/cargotest/support/paths.rs.orig	Fri Jan 27 08:50:00 2017
+++ tests/cargotest/support/paths.rs	Sat Feb  4 07:18:18 2017
@@ -1,4 +1,3 @@
-use std::env;
 use std::cell::Cell;
 use std::fs;
 use std::io::{self, ErrorKind};
@@ -30,19 +29,7 @@ fn init() {
 }
 
 fn global_root() -> PathBuf {
-    let mut path = t!(env::current_exe());
-    path.pop(); // chop off exe name
-    path.pop(); // chop off 'debug'
-
-    // If `cargo test` is run manually then our path looks like
-    // `target/debug/foo`, in which case our `path` is already pointing at
-    // `target`. If, however, `cargo test --target $target` is used then the
-    // output is `target/$target/debug/foo`, so our path is pointing at
-    // `target/$target`. Here we conditionally pop the `$target` name.
-    if path.file_name().and_then(|s| s.to_str()) != Some("target") {
-        path.pop();
-    }
-
+    let path = PathBuf::from("${MODCARGO_TARGET_DIR}/debug");
     path.join(CARGO_INTEGRATION_TEST_DIR)
 }
 
