Skip to content

Commit a56a6d7

Browse files
committed
bootstrap: pass '--pass' on to compiletest.
1 parent 85ed21e commit a56a6d7

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/bootstrap/builder/tests.rs

+2
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ fn test_with_no_doc_stage0() {
598598
bless: false,
599599
compare_mode: None,
600600
rustfix_coverage: false,
601+
pass: None,
601602
};
602603

603604
let build = Build::new(config);
@@ -640,6 +641,7 @@ fn test_exclude() {
640641
bless: false,
641642
compare_mode: None,
642643
rustfix_coverage: false,
644+
pass: None,
643645
};
644646

645647
let build = Build::new(config);

src/bootstrap/flags.rs

+17
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub enum Subcommand {
5858
/// Whether to automatically update stderr/stdout files
5959
bless: bool,
6060
compare_mode: Option<String>,
61+
pass: Option<String>,
6162
test_args: Vec<String>,
6263
rustc_args: Vec<String>,
6364
fail_fast: bool,
@@ -199,6 +200,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`"
199200
"mode describing what file the actual ui output will be compared to",
200201
"COMPARE MODE",
201202
);
203+
opts.optopt(
204+
"",
205+
"pass",
206+
"force {check,build,run}-pass tests to this mode.",
207+
"check | build | run"
208+
);
202209
opts.optflag(
203210
"",
204211
"rustfix-coverage",
@@ -401,6 +408,7 @@ Arguments:
401408
paths,
402409
bless: matches.opt_present("bless"),
403410
compare_mode: matches.opt_str("compare-mode"),
411+
pass: matches.opt_str("pass"),
404412
test_args: matches.opt_strs("test-args"),
405413
rustc_args: matches.opt_strs("rustc-args"),
406414
fail_fast: !matches.opt_present("no-fail-fast"),
@@ -524,6 +532,15 @@ impl Subcommand {
524532
_ => None,
525533
}
526534
}
535+
536+
pub fn pass(&self) -> Option<&str> {
537+
match *self {
538+
Subcommand::Test {
539+
ref pass, ..
540+
} => pass.as_ref().map(|s| &s[..]),
541+
_ => None,
542+
}
543+
}
527544
}
528545

529546
fn split(s: &[String]) -> Vec<String> {

src/bootstrap/test.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,11 @@ impl Step for Compiletest {
10651065
}
10661066
});
10671067

1068+
if let Some(ref pass) = builder.config.cmd.pass() {
1069+
cmd.arg("--pass");
1070+
cmd.arg(pass);
1071+
}
1072+
10681073
if let Some(ref nodejs) = builder.config.nodejs {
10691074
cmd.arg("--nodejs").arg(nodejs);
10701075
}

0 commit comments

Comments
 (0)