Pārlūkot izejas kodu

Merge pull request #666 from lameloball2813-ui/fix/load-probe-target-dir

Loader tests: build the probe fixture under CARGO_TARGET_TMPDIR
Marvis 2 dienas atpakaļ
vecāks
revīzija
16bd5771a0
1 mainītis faili ar 5 papildinājumiem un 4 dzēšanām
  1. 5 4
      crates/victory-loader/tests/load_probe.rs

+ 5 - 4
crates/victory-loader/tests/load_probe.rs

@@ -20,11 +20,12 @@ fn workspace_root() -> PathBuf {
 }
 
 /// Builds the fixture into its own target dir (the outer cargo holds the
-/// lock on the main one while tests run).
+/// lock on the main one while tests run), in the outer one's scratch folder
+/// for tests, so that it follows `CARGO_TARGET_DIR` like the rest of the
+/// build.
 fn build_probe() -> PathBuf {
-    let root = workspace_root();
-    let manifest = root.join("tests/fixtures/hle-probe/Cargo.toml");
-    let target = root.join("target/fixtures");
+    let manifest = workspace_root().join("tests/fixtures/hle-probe/Cargo.toml");
+    let target = Path::new(env!("CARGO_TARGET_TMPDIR")).join("hle-probe");
     let status = Command::new(env!("CARGO"))
         .args(["build", "--quiet", "--manifest-path"])
         .arg(&manifest)