|
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; |
@@ -98,6 +100,7 @@ pub fn parse_config(args: Vec<String>) -> Config { |
98 | 100 | ) |
99 | 101 | .optopt("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS") |
100 | 102 | .optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS") |
| 103 | + .optopt("", "target-panic", "what panic strategy the target supports", "unwind | abort") |
101 | 104 | .optflag("", "verbose", "run tests verbosely, showing all output") |
102 | 105 | .optflag( |
103 | 106 | "", |
@@ -238,6 +241,11 @@ pub fn parse_config(args: Vec<String>) -> Config { |
238 | 241 | runtool: matches.opt_str("runtool"), |
239 | 242 | host_rustcflags: matches.opt_str("host-rustcflags"), |
240 | 243 | target_rustcflags: matches.opt_str("target-rustcflags"), |
| 244 | + target_panic: match matches.opt_str("target-panic").as_deref() { |
| 245 | + Some("unwind") | None => PanicStrategy::Unwind, |
| 246 | + Some("abort") => PanicStrategy::Abort, |
| 247 | + _ => panic!("unknown `--target-panic` option `{}` given", mode), |
| 248 | + }, |
241 | 249 | target, |
242 | 250 | host: opt_str2(matches.opt_str("host")), |
243 | 251 | cdb, |
|
0 commit comments