|
5 | 5 |
|
6 | 6 | extern crate test;
|
7 | 7 |
|
8 |
| -use crate::common::{expected_output_path, output_base_dir, output_relative_path, UI_EXTENSIONS}; |
| 8 | +use crate::common::{ |
| 9 | + expected_output_path, output_base_dir, output_relative_path, PanicStrategy, UI_EXTENSIONS, |
| 10 | +}; |
9 | 11 | use crate::common::{CompareMode, Config, Debugger, Mode, PassMode, Pretty, TestPaths};
|
10 | 12 | use crate::util::logv;
|
11 | 13 | use getopts::Options;
|
@@ -97,8 +99,9 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
97 | 99 | (eg. emulator, valgrind)",
|
98 | 100 | "PROGRAM",
|
99 | 101 | )
|
100 |
| - .optopt("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS") |
101 |
| - .optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS") |
| 102 | + .optmulti("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS") |
| 103 | + .optmulti("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS") |
| 104 | + .optopt("", "target-panic", "what panic strategy the target supports", "unwind | abort") |
102 | 105 | .optflag("", "verbose", "run tests verbosely, showing all output")
|
103 | 106 | .optflag(
|
104 | 107 | "",
|
@@ -243,8 +246,13 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
243 | 246 | }),
|
244 | 247 | logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
|
245 | 248 | runtool: matches.opt_str("runtool"),
|
246 |
| - host_rustcflags: matches.opt_str("host-rustcflags"), |
247 |
| - target_rustcflags: matches.opt_str("target-rustcflags"), |
| 249 | + host_rustcflags: Some(matches.opt_strs("host-rustcflags").join(" ")), |
| 250 | + target_rustcflags: Some(matches.opt_strs("target-rustcflags").join(" ")), |
| 251 | + target_panic: match matches.opt_str("target-panic").as_deref() { |
| 252 | + Some("unwind") | None => PanicStrategy::Unwind, |
| 253 | + Some("abort") => PanicStrategy::Abort, |
| 254 | + _ => panic!("unknown `--target-panic` option `{}` given", mode), |
| 255 | + }, |
248 | 256 | target,
|
249 | 257 | host: opt_str2(matches.opt_str("host")),
|
250 | 258 | cdb,
|
|
0 commit comments