about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2021-04-30 04:01:04 +0000
committerTyler Mandry <tmandry@gmail.com>2021-05-06 02:49:34 +0000
commit1993e1a86d44c0a6eb54b9a1d6c8c636eb094c68 (patch)
tree1b0ea97b3d0a3f53d60c1fc042e7471526d959ae
parente1a8ecf771485d517010c66b8532c39635725813 (diff)
downloadrust-1993e1a86d44c0a6eb54b9a1d6c8c636eb094c68.tar.gz
rust-1993e1a86d44c0a6eb54b9a1d6c8c636eb094c68.zip
Support multi target-rustcflags for -Zpanic-abort-tests
I just need this until rustbuild supports -Cpanic=abort std directly.
-rw-r--r--src/test/ui/test-panic-abort-disabled.rs2
-rw-r--r--src/tools/compiletest/src/main.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/ui/test-panic-abort-disabled.rs b/src/test/ui/test-panic-abort-disabled.rs
index 4adb161d9ee..874dbdb42c3 100644
--- a/src/test/ui/test-panic-abort-disabled.rs
+++ b/src/test/ui/test-panic-abort-disabled.rs
@@ -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
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index 17e4cfdedc6..5edeefb6099 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -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,