]> git.lizzy.rs Git - rust.git/commitdiff
Fail on internal compiler errors in compile-fail
authorRicho Healey <richo@psych0tik.net>
Tue, 6 May 2014 08:33:24 +0000 (01:33 -0700)
committerRicho Healey <richo@psych0tik.net>
Wed, 7 May 2014 04:47:21 +0000 (21:47 -0700)
src/compiletest/runtest.rs

index 9ce81c5bae53d9915c9e04d7394799c2d392d838..c1ca27c805cdb2b843e264dc4918328c1c6b4760 100644 (file)
@@ -89,6 +89,7 @@ fn run_cfail_test(config: &config, props: &TestProps, testfile: &Path) {
     } else {
         check_error_patterns(props, testfile, &proc_res);
     }
+    check_no_compiler_crash(&proc_res);
 }
 
 fn run_rfail_test(config: &config, props: &TestProps, testfile: &Path) {
@@ -505,6 +506,15 @@ fn check_error_patterns(props: &TestProps,
     }
 }
 
+fn check_no_compiler_crash(proc_res: &ProcRes) {
+    for line in proc_res.stderr.lines() {
+        if line.starts_with("error: internal compiler error:") {
+            fatal_ProcRes("compiler encountered internal error".to_owned(),
+                          proc_res);
+        }
+    }
+}
+
 fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
                          testfile: &Path,
                          proc_res: &ProcRes) {