about summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Boyer <qbsecond@gmail.com>2019-11-08 17:38:15 +0100
committerQuentin Boyer <qbsecond@gmail.com>2019-11-08 17:38:15 +0100
commite01d9415e26dfcdd31c182bec21049502f5477ff (patch)
tree419329fc4aa3b743aaf018d8a1eccd660008a28c
parent5852a3f4e9f07d7cb2cc155fbb071ce97c377a6a (diff)
downloadrust-e01d9415e26dfcdd31c182bec21049502f5477ff.tar.gz
rust-e01d9415e26dfcdd31c182bec21049502f5477ff.zip
check for sould-ice either in compilefail or incremental cfail
-rw-r--r--src/tools/compiletest/src/runtest.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index fd250d6c7a6..1782074fc92 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -298,6 +298,12 @@ impl<'test> TestCx<'test> {
     /// Code executed for each revision in turn (or, if there are no
     /// revisions, exactly once, with revision == None).
     fn run_revision(&self) {
+        if self.props.should_ice {
+            if self.config.mode != CompileFail &&
+                self.config.mode != Incremental {
+                self.fatal("cannot use should-ice in a test that is not cfail");
+            }
+        }
         match self.config.mode {
             CompileFail => self.run_cfail_test(),
             RunFail => self.run_rfail_test(),
@@ -2782,8 +2788,14 @@ impl<'test> TestCx<'test> {
         }
 
         if revision.starts_with("rpass") {
+            if revision_cx.props.should_ice {
+                revision_cx.fatal("can only use should-ice in cfail tests");
+            }
             revision_cx.run_rpass_test();
         } else if revision.starts_with("rfail") {
+            if revision_cx.props.should_ice {
+                revision_cx.fatal("can only use should-ice in cfail tests");
+            }
             revision_cx.run_rfail_test();
         } else if revision.starts_with("cfail") {
             revision_cx.run_cfail_test();