$OpenBSD: patch-src_tools_cargo_crates_cargo-test-support_src_paths_rs,v 1.4 2021/03/27 10:02:11 semarie Exp $

Index: src/tools/cargo/crates/cargo-test-support/src/paths.rs
--- src/tools/cargo/crates/cargo-test-support/src/paths.rs.orig
+++ src/tools/cargo/crates/cargo-test-support/src/paths.rs
@@ -15,19 +15,7 @@ static CARGO_INTEGRATION_TEST_DIR: &str = "cit";
 
 lazy_static! {
     pub static ref 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.push(CARGO_INTEGRATION_TEST_DIR);
         path.mkdir_p();
         path
