Skip to content

Commit 0978381

Browse files
committed
Add run flag to bootstrap test
1 parent 051f9ec commit 0978381

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/bootstrap/builder/tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ mod dist {
489489
compare_mode: None,
490490
rustfix_coverage: false,
491491
pass: None,
492+
run: None,
492493
};
493494

494495
let build = Build::new(config);
@@ -529,6 +530,7 @@ mod dist {
529530
compare_mode: None,
530531
rustfix_coverage: false,
531532
pass: None,
533+
run: None,
532534
};
533535

534536
let build = Build::new(config);
@@ -584,6 +586,7 @@ mod dist {
584586
compare_mode: None,
585587
rustfix_coverage: false,
586588
pass: None,
589+
run: None,
587590
};
588591
// Make sure rustfmt binary not being found isn't an error.
589592
config.channel = "beta".to_string();

src/bootstrap/flags.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ pub enum Subcommand {
103103
bless: bool,
104104
compare_mode: Option<String>,
105105
pass: Option<String>,
106+
run: Option<String>,
106107
test_args: Vec<String>,
107108
rustc_args: Vec<String>,
108109
fail_fast: bool,
@@ -293,6 +294,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
293294
"force {check,build,run}-pass tests to this mode.",
294295
"check | build | run",
295296
);
297+
opts.optopt(
298+
"",
299+
"run",
300+
"whether to execute run-* tests",
301+
"auto | always | never",
302+
);
296303
opts.optflag(
297304
"",
298305
"rustfix-coverage",
@@ -556,6 +563,7 @@ Arguments:
556563
bless: matches.opt_present("bless"),
557564
compare_mode: matches.opt_str("compare-mode"),
558565
pass: matches.opt_str("pass"),
566+
run: matches.opt_str("run"),
559567
test_args: matches.opt_strs("test-args"),
560568
rustc_args: matches.opt_strs("rustc-args"),
561569
fail_fast: !matches.opt_present("no-fail-fast"),
@@ -742,6 +750,13 @@ impl Subcommand {
742750
}
743751
}
744752

753+
pub fn run(&self) -> Option<&str> {
754+
match *self {
755+
Subcommand::Test { ref run, .. } => run.as_ref().map(|s| &s[..]),
756+
_ => None,
757+
}
758+
}
759+
745760
pub fn open(&self) -> bool {
746761
match *self {
747762
Subcommand::Doc { open, .. } => open,

src/bootstrap/test.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,11 @@ note: if you're sure you want to do this, please open an issue as to why. In the
12071207
cmd.arg(pass);
12081208
}
12091209

1210+
if let Some(ref run) = builder.config.cmd.run() {
1211+
cmd.arg("--run");
1212+
cmd.arg(run);
1213+
}
1214+
12101215
if let Some(ref nodejs) = builder.config.nodejs {
12111216
cmd.arg("--nodejs").arg(nodejs);
12121217
}

0 commit comments

Comments
 (0)