about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbit-aloo <sshourya17@gmail.com>2025-09-16 21:16:29 +0530
committerbit-aloo <sshourya17@gmail.com>2025-09-21 20:56:09 +0530
commit6c79f547f9ecf72ff8b9748dc0001d92217dff71 (patch)
treecbfc647a56dfb800a4191cd06a29c81453916dd3
parenta12969e0d10387ad17755879e98cf5097a937473 (diff)
downloadrust-6c79f547f9ecf72ff8b9748dc0001d92217dff71.tar.gz
rust-6c79f547f9ecf72ff8b9748dc0001d92217dff71.zip
add an API in ConfigBuilder to point to config file for toml parsing
-rw-r--r--src/bootstrap/src/utils/tests/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/src/utils/tests/mod.rs b/src/bootstrap/src/utils/tests/mod.rs
index 3332187e2a8..ff84bfdb4cd 100644
--- a/src/bootstrap/src/utils/tests/mod.rs
+++ b/src/bootstrap/src/utils/tests/mod.rs
@@ -98,6 +98,14 @@ impl ConfigBuilder {
         self
     }
 
+    pub fn config_toml(mut self, config_toml: &str) -> Self {
+        let toml_path = self.directory.join("bootstrap.toml");
+        std::fs::write(&toml_path, config_toml).unwrap();
+        self.args.push("--config".to_string());
+        self.args.push(toml_path.display().to_string());
+        self
+    }
+
     pub fn create_config(mut self) -> Config {
         // Run in dry-check, otherwise the test would be too slow
         self.args.push("--dry-run".to_string());