$OpenBSD: patch-src_tools_cargo_tests_testsuite_support_paths_rs,v 1.1 2018/09/16 16:35:27 landry Exp $

Index: src/tools/cargo/tests/testsuite/support/paths.rs
--- src/tools/cargo/tests/testsuite/support/paths.rs.orig
+++ src/tools/cargo/tests/testsuite/support/paths.rs
@@ -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("${WRKBUILD}/test-cargo");
     path.join(CARGO_INTEGRATION_TEST_DIR)
 }
 
