about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorNadrieril <Nadrieril@users.noreply.github.com>2024-01-31 12:10:49 +0100
committerGitHub <noreply@github.com>2024-01-31 12:10:49 +0100
commitbcb709b30f7f4e2114b5d4f1d505f9476621c72e (patch)
tree69fe29aee1e4212cc2f32fcf8f94264e60237936 /src/bootstrap
parentcdaa12e3dff109f72a5a8a0a67ea225052122a79 (diff)
parentdfbbdda56e4ccc0d660dbb5594fa21a6f799cb21 (diff)
Rollup merge of #120207 - onur-ozkan:120202-fix, r=clubby789
check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test

Fixes a logical bug in `profile_user_dist` test (explained in #120202).
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/config/tests.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
index 201d11571c4..0ae466eca7d 100644
--- a/src/bootstrap/src/core/config/tests.rs
+++ b/src/bootstrap/src/core/config/tests.rs
@@ -174,12 +174,14 @@ fn override_toml_duplicate() {
 #[test]
 fn profile_user_dist() {
     fn get_toml(file: &Path) -> TomlConfig {
-        let contents = if file.ends_with("config.toml") {
-            "profile = \"user\"".to_owned()
-        } else {
-            assert!(file.ends_with("config.dist.toml"));
-            std::fs::read_to_string(file).unwrap()
-        };
+        let contents =
+            if file.ends_with("config.toml") || env::var_os("RUST_BOOTSTRAP_CONFIG").is_some() {
+                "profile = \"user\"".to_owned()
+            } else {
+                assert!(file.ends_with("config.dist.toml"));
+                std::fs::read_to_string(file).unwrap()
+            };
+
         toml::from_str(&contents)
             .and_then(|table: toml::Value| TomlConfig::deserialize(table))
             .unwrap()