Skip to content

Commit 05131bd

Browse files
committed
move most of the test to new testCtx
1 parent 24ed1a0 commit 05131bd

File tree

3 files changed

+152
-191
lines changed

3 files changed

+152
-191
lines changed

src/bootstrap/src/core/builder/tests.rs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,16 @@ fn prepare_rustc_checkout(ctx: &mut GitCtx) {
218218

219219
/// Parses a Config directory from `path`, with the given value of `download_rustc`.
220220
fn parse_config_download_rustc_at(path: &Path, download_rustc: &str, ci: bool) -> Config {
221-
Config::parse_inner(
222-
Flags::parse(&[
223-
"build".to_owned(),
224-
"--dry-run".to_owned(),
225-
"--ci".to_owned(),
226-
if ci { "true" } else { "false" }.to_owned(),
227-
format!("--set=rust.download-rustc='{download_rustc}'"),
228-
"--src".to_owned(),
229-
path.to_str().unwrap().to_owned(),
230-
]),
231-
|&_| Ok(Default::default()),
232-
)
221+
TestCtx::new()
222+
.config("build")
223+
.args(&[
224+
"--ci",
225+
if ci { "true" } else { "false" },
226+
format!("--set=rust.download-rustc='{download_rustc}'").as_str(),
227+
"--src",
228+
path.to_str().unwrap(),
229+
])
230+
.create_config_without_ci_llvm_override()
233231
}
234232

235233
mod dist {
@@ -359,14 +357,7 @@ fn test_test_coverage() {
359357
#[test]
360358
fn test_prebuilt_llvm_config_path_resolution() {
361359
fn configure(config: &str) -> Config {
362-
Config::parse_inner(
363-
Flags::parse(&[
364-
"build".to_string(),
365-
"--dry-run".to_string(),
366-
"--config=/does/not/exist".to_string(),
367-
]),
368-
|&_| toml::from_str(&config),
369-
)
360+
TestCtx::new().config("build").config_toml(config).create_config()
370361
}
371362

372363
// Removes Windows disk prefix if present

0 commit comments

Comments
 (0)