Skip to content

Commit

Permalink
bootstrap: pass '--pass' on to compiletest.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Jun 24, 2019
1 parent 85ed21e commit a56a6d7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bootstrap/builder/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ fn test_with_no_doc_stage0() {
bless: false,
compare_mode: None,
rustfix_coverage: false,
pass: None,
};

let build = Build::new(config);
Expand Down Expand Up @@ -640,6 +641,7 @@ fn test_exclude() {
bless: false,
compare_mode: None,
rustfix_coverage: false,
pass: None,
};

let build = Build::new(config);
Expand Down
17 changes: 17 additions & 0 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pub enum Subcommand {
/// Whether to automatically update stderr/stdout files
bless: bool,
compare_mode: Option<String>,
pass: Option<String>,
test_args: Vec<String>,
rustc_args: Vec<String>,
fail_fast: bool,
Expand Down Expand Up @@ -199,6 +200,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`"
"mode describing what file the actual ui output will be compared to",
"COMPARE MODE",
);
opts.optopt(
"",
"pass",
"force {check,build,run}-pass tests to this mode.",
"check | build | run"
);
opts.optflag(
"",
"rustfix-coverage",
Expand Down Expand Up @@ -401,6 +408,7 @@ Arguments:
paths,
bless: matches.opt_present("bless"),
compare_mode: matches.opt_str("compare-mode"),
pass: matches.opt_str("pass"),
test_args: matches.opt_strs("test-args"),
rustc_args: matches.opt_strs("rustc-args"),
fail_fast: !matches.opt_present("no-fail-fast"),
Expand Down Expand Up @@ -524,6 +532,15 @@ impl Subcommand {
_ => None,
}
}

pub fn pass(&self) -> Option<&str> {
match *self {
Subcommand::Test {
ref pass, ..
} => pass.as_ref().map(|s| &s[..]),
_ => None,
}
}
}

fn split(s: &[String]) -> Vec<String> {
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,11 @@ impl Step for Compiletest {
}
});

if let Some(ref pass) = builder.config.cmd.pass() {
cmd.arg("--pass");
cmd.arg(pass);
}

if let Some(ref nodejs) = builder.config.nodejs {
cmd.arg("--nodejs").arg(nodejs);
}
Expand Down

0 comments on commit a56a6d7

Please sign in to comment.