]> git.proxmox.com Git - cargo.git/commitdiff
Make the empty rustc-wrapper test more explicit.
authorEric Huss <eric@huss.org>
Sun, 24 Jul 2022 20:10:35 +0000 (13:10 -0700)
committerEric Huss <eric@huss.org>
Sun, 24 Jul 2022 20:10:35 +0000 (13:10 -0700)
tests/testsuite/check.rs

index f54339aa19662b6b2674ed0a30b0dc25a7a1cd60..4ec3de51ec094e578001ed32661acef9ba33ec9f 100644 (file)
@@ -870,7 +870,18 @@ fn check_keep_going() {
 
 #[cargo_test]
 fn does_not_use_empty_rustc_wrapper() {
-    let p = project().file("src/lib.rs", "").build();
+    // An empty RUSTC_WRAPPER environment variable won't be used.
+    // The env var will also override the config, essentially unsetting it.
+    let p = project()
+        .file("src/lib.rs", "")
+        .file(
+            ".cargo/config.toml",
+            r#"
+                [build]
+                rustc-wrapper = "do-not-execute-me"
+            "#,
+        )
+        .build();
     p.cargo("check").env("RUSTC_WRAPPER", "").run();
 }