diff options
| author | kennytm <kennytm@gmail.com> | 2018-01-23 17:03:39 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-23 17:03:39 +0800 |
| commit | 52f8d2dc35eea1029954b455d8a463a96cbb2d1c (patch) | |
| tree | 5f9512d460b0c0cd0d6c626f41922a249b5c7454 /src/bootstrap/flags.rs | |
| parent | 60b987d0a93b1d456e23fb3e2334d84b8ac21777 (diff) | |
| parent | db41f1e1cfa0d817a96830fecbdcf70d249597e7 (diff) | |
| download | rust-52f8d2dc35eea1029954b455d8a463a96cbb2d1c.tar.gz rust-52f8d2dc35eea1029954b455d8a463a96cbb2d1c.zip | |
Rollup merge of #47558 - spastorino:rustc_args, r=nikomatsakis
Add rustc-args option to test runner r? @nikomatsakis
Diffstat (limited to 'src/bootstrap/flags.rs')
| -rw-r--r-- | src/bootstrap/flags.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index b5d51598fab..0816c4dfe3d 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -54,6 +54,7 @@ pub enum Subcommand { Test { paths: Vec<PathBuf>, test_args: Vec<String>, + rustc_args: Vec<String>, fail_fast: bool, }, Bench { @@ -150,6 +151,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`"); "test" => { opts.optflag("", "no-fail-fast", "Run all tests regardless of failure"); opts.optmulti("", "test-args", "extra arguments", "ARGS"); + opts.optmulti( + "", + "rustc-args", + "extra options to pass the compiler when running tests", + "ARGS", + ); }, "bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); }, "clean" => { opts.optflag("", "all", "clean all build artifacts"); }, @@ -283,6 +290,7 @@ Arguments: Subcommand::Test { paths, test_args: matches.opt_strs("test-args"), + rustc_args: matches.opt_strs("rustc-args"), fail_fast: !matches.opt_present("no-fail-fast"), } } @@ -362,6 +370,15 @@ impl Subcommand { } } + pub fn rustc_args(&self) -> Vec<&str> { + match *self { + Subcommand::Test { ref rustc_args, .. } => { + rustc_args.iter().flat_map(|s| s.split_whitespace()).collect() + } + _ => Vec::new(), + } + } + pub fn fail_fast(&self) -> bool { match *self { Subcommand::Test { fail_fast, .. } => fail_fast, |
