Skip to content

Commit 1993e1a

Browse files
committed
Support multi target-rustcflags for -Zpanic-abort-tests
I just need this until rustbuild supports -Cpanic=abort std directly.
1 parent e1a8ecf commit 1993e1a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/test/ui/test-panic-abort-disabled.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// error-pattern:building tests with panic=abort is not supported
22
// no-prefer-dynamic
3-
// compile-flags: --test -Cpanic=abort
3+
// compile-flags: --test -Cpanic=abort -Zpanic-abort-tests=no
44
// run-flags: --test-threads=1
55

66
// ignore-wasm no panic or subprocess support

src/tools/compiletest/src/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
9898
(eg. emulator, valgrind)",
9999
"PROGRAM",
100100
)
101-
.optopt("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS")
102-
.optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS")
101+
.optmulti("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS")
102+
.optmulti("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS")
103103
.optopt("", "target-panic", "what panic strategy the target supports", "unwind | abort")
104104
.optflag("", "verbose", "run tests verbosely, showing all output")
105105
.optflag(
@@ -239,8 +239,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
239239
}),
240240
logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
241241
runtool: matches.opt_str("runtool"),
242-
host_rustcflags: matches.opt_str("host-rustcflags"),
243-
target_rustcflags: matches.opt_str("target-rustcflags"),
242+
host_rustcflags: Some(matches.opt_strs("host-rustcflags").join(" ")),
243+
target_rustcflags: Some(matches.opt_strs("target-rustcflags").join(" ")),
244244
target_panic: match matches.opt_str("target-panic").as_deref() {
245245
Some("unwind") | None => PanicStrategy::Unwind,
246246
Some("abort") => PanicStrategy::Abort,

0 commit comments

Comments
 (0)