about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAhmed Charles <acharles@outlook.com>2016-08-22 16:51:37 -0700
committerAhmed Charles <acharles@outlook.com>2016-08-22 16:51:37 -0700
commit6961d267298b6ca0507520de5541883374d31302 (patch)
tree51012dc2bb2600032c0ba8141f91665abeb744a9
parent197be89f367d1240d5f9cd9c4efd77812775354e (diff)
downloadrust-6961d267298b6ca0507520de5541883374d31302.tar.gz
rust-6961d267298b6ca0507520de5541883374d31302.zip
Fix compiletest so it respects warnings for run-pass.
-rw-r--r--src/test/run-pass-fulldeps/deprecated-derive.rs1
-rw-r--r--src/test/run-pass-fulldeps/lint-group-plugin.rs1
-rw-r--r--src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs2
-rw-r--r--src/test/run-pass-fulldeps/lint-plugin.rs1
-rw-r--r--src/test/run-pass/attr-before-view-item.rs2
-rw-r--r--src/test/run-pass/attr-before-view-item2.rs2
-rw-r--r--src/test/run-pass/deriving-meta-empty-trait-list.rs1
-rw-r--r--src/test/run-pass/enum-size-variance.rs8
-rw-r--r--src/test/run-pass/issue-19100.rs4
-rw-r--r--src/test/run-pass/issue-25757.rs2
-rw-r--r--src/test/run-pass/issue-2611-3.rs1
-rw-r--r--src/test/run-pass/issue-27320.rs3
-rw-r--r--src/test/run-pass/liveness-assign-imm-local-after-ret.rs4
-rw-r--r--src/test/run-pass/unreachable-code-1.rs4
-rw-r--r--src/tools/compiletest/src/runtest.rs10
15 files changed, 30 insertions, 16 deletions
diff --git a/src/test/run-pass-fulldeps/deprecated-derive.rs b/src/test/run-pass-fulldeps/deprecated-derive.rs
index 69a7f888bbe..be2a45ca79a 100644
--- a/src/test/run-pass-fulldeps/deprecated-derive.rs
+++ b/src/test/run-pass-fulldeps/deprecated-derive.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![feature(rustc_private)]
+#![allow(dead_code)]
 
 extern crate serialize;
 
diff --git a/src/test/run-pass-fulldeps/lint-group-plugin.rs b/src/test/run-pass-fulldeps/lint-group-plugin.rs
index 1a639cdb9dd..21942b84bff 100644
--- a/src/test/run-pass-fulldeps/lint-group-plugin.rs
+++ b/src/test/run-pass-fulldeps/lint-group-plugin.rs
@@ -14,6 +14,7 @@
 
 #![feature(plugin)]
 #![plugin(lint_group_plugin_test)]
+#![allow(dead_code)]
 
 fn lintme() { } //~ WARNING item is named 'lintme'
 fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
diff --git a/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs b/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs
index 1af26094f23..2a6daa5040b 100644
--- a/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs
+++ b/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs
@@ -13,6 +13,8 @@
 // ignore-pretty: Random space appears with the pretty test
 // compile-flags: -Z extra-plugins=lint_plugin_test
 
+#![allow(dead_code)]
+
 fn lintme() { } //~ WARNING item is named 'lintme'
 
 #[allow(test_lint)]
diff --git a/src/test/run-pass-fulldeps/lint-plugin.rs b/src/test/run-pass-fulldeps/lint-plugin.rs
index 8311e188f92..b694a1c3320 100644
--- a/src/test/run-pass-fulldeps/lint-plugin.rs
+++ b/src/test/run-pass-fulldeps/lint-plugin.rs
@@ -14,6 +14,7 @@
 
 #![feature(plugin)]
 #![plugin(lint_plugin_test)]
+#![allow(dead_code)]
 
 fn lintme() { } //~ WARNING item is named 'lintme'
 
diff --git a/src/test/run-pass/attr-before-view-item.rs b/src/test/run-pass/attr-before-view-item.rs
index cdd1b96de1e..2a86489c69a 100644
--- a/src/test/run-pass/attr-before-view-item.rs
+++ b/src/test/run-pass/attr-before-view-item.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:expected item
-
 // pretty-expanded FIXME #23616
 
 #![feature(custom_attribute, test)]
diff --git a/src/test/run-pass/attr-before-view-item2.rs b/src/test/run-pass/attr-before-view-item2.rs
index cd02b5a9e73..c8683f2d147 100644
--- a/src/test/run-pass/attr-before-view-item2.rs
+++ b/src/test/run-pass/attr-before-view-item2.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:expected item
-
 // pretty-expanded FIXME #23616
 
 #![feature(custom_attribute, test)]
diff --git a/src/test/run-pass/deriving-meta-empty-trait-list.rs b/src/test/run-pass/deriving-meta-empty-trait-list.rs
index 5b55ef63335..ff513325d5e 100644
--- a/src/test/run-pass/deriving-meta-empty-trait-list.rs
+++ b/src/test/run-pass/deriving-meta-empty-trait-list.rs
@@ -10,6 +10,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![allow(dead_code)]
 
 #[derive]   //~ WARNING empty trait list in `derive`
 struct Foo;
diff --git a/src/test/run-pass/enum-size-variance.rs b/src/test/run-pass/enum-size-variance.rs
index 0bf5df5d610..21996c5fabf 100644
--- a/src/test/run-pass/enum-size-variance.rs
+++ b/src/test/run-pass/enum-size-variance.rs
@@ -10,7 +10,7 @@
 //
 // ignore-pretty
 
-#![deny(enum_size_variance)]
+#![warn(variant_size_differences)]
 #![allow(dead_code)]
 
 enum Enum1 { }
@@ -21,8 +21,8 @@ enum Enum3 { D(isize), E, F }
 
 enum Enum4 { H(isize), I(isize), J }
 
-enum Enum5 { //~ ERROR three times larger
-    L(isize, isize, isize, isize), //~ NOTE this variant is the largest
+enum Enum5 {
+    L(isize, isize, isize, isize), //~ WARNING three times larger
     M(isize),
     N
 }
@@ -33,7 +33,7 @@ enum Enum6<T, U> {
     Q(isize)
 }
 
-#[allow(enum_size_variance)]
+#[allow(variant_size_differences)]
 enum Enum7 {
     R(isize, isize, isize, isize),
     S(isize),
diff --git a/src/test/run-pass/issue-19100.rs b/src/test/run-pass/issue-19100.rs
index 0fd4b4394dc..7ff9ae996f5 100644
--- a/src/test/run-pass/issue-19100.rs
+++ b/src/test/run-pass/issue-19100.rs
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![allow(non_snake_case)]
+#![allow(dead_code)]
+#![allow(unused_variables)]
+
 #[derive(Copy, Clone)]
 enum Foo {
     Bar,
diff --git a/src/test/run-pass/issue-25757.rs b/src/test/run-pass/issue-25757.rs
index 8deb2e244ae..d1fb7537705 100644
--- a/src/test/run-pass/issue-25757.rs
+++ b/src/test/run-pass/issue-25757.rs
@@ -22,6 +22,6 @@ const FUNC: &'static Fn(&mut Foo) -> () = &Foo::x;
 
 fn main() {
     let mut foo = Foo { a: 137 };
-    FUNC(&mut foo); //~ ERROR bad
+    FUNC(&mut foo);
     assert_eq!(foo.a, 5);
 }
diff --git a/src/test/run-pass/issue-2611-3.rs b/src/test/run-pass/issue-2611-3.rs
index 242528dcb14..e223d3412e0 100644
--- a/src/test/run-pass/issue-2611-3.rs
+++ b/src/test/run-pass/issue-2611-3.rs
@@ -22,7 +22,6 @@ struct E {
 
 impl A for E {
   fn b<F,G>(&self, _x: F) -> F { panic!() }
-  //~^ ERROR in method `b`, type parameter 0 has 1 bound, but
 }
 
 pub fn main() {}
diff --git a/src/test/run-pass/issue-27320.rs b/src/test/run-pass/issue-27320.rs
index dde1d3bfe93..e010b162cc4 100644
--- a/src/test/run-pass/issue-27320.rs
+++ b/src/test/run-pass/issue-27320.rs
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![allow(unused_variables)]
+#![allow(dead_code)]
+
 macro_rules! piece(
     ($piece:pat) => ($piece);
 );
diff --git a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs
index 6fc15478f7a..76b44832a8a 100644
--- a/src/test/run-pass/liveness-assign-imm-local-after-ret.rs
+++ b/src/test/run-pass/liveness-assign-imm-local-after-ret.rs
@@ -10,13 +10,13 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unreachable_code)]
+#![allow(dead_code)]
 
 fn test() {
     let _v: isize;
     _v = 1;
     return;
-    _v = 2; //~ WARNING: unreachable statement
+    _v = 2;
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs
index 189c5cdb9b7..6448056fb11 100644
--- a/src/test/run-pass/unreachable-code-1.rs
+++ b/src/test/run-pass/unreachable-code-1.rs
@@ -9,14 +9,14 @@
 // except according to those terms.
 
 
-#![allow(unreachable_code)]
 #![allow(unused_variables)]
+#![allow(dead_code)]
 
 fn id(x: bool) -> bool { x }
 
 fn call_id() {
     let c = panic!();
-    id(c); //~ WARNING unreachable statement
+    id(c);
 }
 
 fn call_id_3() { id(return) && id(return); }
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 0d081b267bb..60a0d8f0b86 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -197,6 +197,11 @@ impl<'test> TestCx<'test> {
             self.fatal_proc_rec("compilation failed!", &proc_res);
         }
 
+        let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
+        if !expected_errors.is_empty() {
+            self.check_expected_errors(expected_errors, &proc_res);
+        }
+
         let proc_res = self.exec_compiled_test();
 
         if !proc_res.status.success() {
@@ -992,7 +997,8 @@ actual:\n\
     fn check_expected_errors(&self,
                              expected_errors: Vec<errors::Error>,
                              proc_res: &ProcRes) {
-        if proc_res.status.success() {
+        if proc_res.status.success() &&
+            expected_errors.iter().any(|x| x.kind == Some(ErrorKind::Error)) {
             self.fatal_proc_rec("process did not return an error status", proc_res);
         }
 
@@ -1320,6 +1326,7 @@ actual:\n\
         match self.config.mode {
             CompileFail |
             ParseFail |
+            RunPass |
             Incremental => {
                 // If we are extracting and matching errors in the new
                 // fashion, then you want JSON mode. Old-skool error
@@ -1350,7 +1357,6 @@ actual:\n\
                 args.push(dir_opt);
             }
             RunFail |
-            RunPass |
             RunPassValgrind |
             Pretty |
             DebugInfoGdb |