Support multi target-rustcflags for -Zpanic-abort-tests

I just need this until rustbuild supports -Cpanic=abort std directly.
This commit is contained in:
Tyler Mandry 2021-04-30 04:01:04 +00:00
parent e1a8ecf771
commit 1993e1a86d
2 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
// error-pattern:building tests with panic=abort is not supported
// no-prefer-dynamic
// compile-flags: --test -Cpanic=abort
// compile-flags: --test -Cpanic=abort -Zpanic-abort-tests=no
// run-flags: --test-threads=1
// ignore-wasm no panic or subprocess support

View file

@ -98,8 +98,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
(eg. emulator, valgrind)",
"PROGRAM",
)
.optopt("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS")
.optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS")
.optmulti("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS")
.optmulti("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS")
.optopt("", "target-panic", "what panic strategy the target supports", "unwind | abort")
.optflag("", "verbose", "run tests verbosely, showing all output")
.optflag(
@ -239,8 +239,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
}),
logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
runtool: matches.opt_str("runtool"),
host_rustcflags: matches.opt_str("host-rustcflags"),
target_rustcflags: matches.opt_str("target-rustcflags"),
host_rustcflags: Some(matches.opt_strs("host-rustcflags").join(" ")),
target_rustcflags: Some(matches.opt_strs("target-rustcflags").join(" ")),
target_panic: match matches.opt_str("target-panic").as_deref() {
Some("unwind") | None => PanicStrategy::Unwind,
Some("abort") => PanicStrategy::Abort,