Auto merge of #35674 - ahmedcharles:rpass, r=alexcrichton
Fix compiletest so it respects warnings for run-pass.
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
extern crate serialize;
|
extern crate serialize;
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#![feature(plugin)]
|
#![feature(plugin)]
|
||||||
#![plugin(lint_group_plugin_test)]
|
#![plugin(lint_group_plugin_test)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
fn lintme() { } //~ WARNING item is named 'lintme'
|
fn lintme() { } //~ WARNING item is named 'lintme'
|
||||||
fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
|
fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
// ignore-pretty: Random space appears with the pretty test
|
// ignore-pretty: Random space appears with the pretty test
|
||||||
// compile-flags: -Z extra-plugins=lint_plugin_test
|
// compile-flags: -Z extra-plugins=lint_plugin_test
|
||||||
|
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
fn lintme() { } //~ WARNING item is named 'lintme'
|
fn lintme() { } //~ WARNING item is named 'lintme'
|
||||||
|
|
||||||
#[allow(test_lint)]
|
#[allow(test_lint)]
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#![feature(plugin)]
|
#![feature(plugin)]
|
||||||
#![plugin(lint_plugin_test)]
|
#![plugin(lint_plugin_test)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
fn lintme() { } //~ WARNING item is named 'lintme'
|
fn lintme() { } //~ WARNING item is named 'lintme'
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern:expected item
|
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(custom_attribute, test)]
|
#![feature(custom_attribute, test)]
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern:expected item
|
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(custom_attribute, test)]
|
#![feature(custom_attribute, test)]
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
#[derive] //~ WARNING empty trait list in `derive`
|
#[derive] //~ WARNING empty trait list in `derive`
|
||||||
struct Foo;
|
struct Foo;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
//
|
//
|
||||||
// ignore-pretty
|
// ignore-pretty
|
||||||
|
|
||||||
#![deny(enum_size_variance)]
|
#![warn(variant_size_differences)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
enum Enum1 { }
|
enum Enum1 { }
|
||||||
@@ -21,8 +21,8 @@ enum Enum3 { D(isize), E, F }
|
|||||||
|
|
||||||
enum Enum4 { H(isize), I(isize), J }
|
enum Enum4 { H(isize), I(isize), J }
|
||||||
|
|
||||||
enum Enum5 { //~ ERROR three times larger
|
enum Enum5 {
|
||||||
L(isize, isize, isize, isize), //~ NOTE this variant is the largest
|
L(isize, isize, isize, isize), //~ WARNING three times larger
|
||||||
M(isize),
|
M(isize),
|
||||||
N
|
N
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ enum Enum6<T, U> {
|
|||||||
Q(isize)
|
Q(isize)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(enum_size_variance)]
|
#[allow(variant_size_differences)]
|
||||||
enum Enum7 {
|
enum Enum7 {
|
||||||
R(isize, isize, isize, isize),
|
R(isize, isize, isize, isize),
|
||||||
S(isize),
|
S(isize),
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![allow(non_snake_case)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
#![allow(unused_variables)]
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
enum Foo {
|
enum Foo {
|
||||||
Bar,
|
Bar,
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ const FUNC: &'static Fn(&mut Foo) -> () = &Foo::x;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut foo = Foo { a: 137 };
|
let mut foo = Foo { a: 137 };
|
||||||
FUNC(&mut foo); //~ ERROR bad
|
FUNC(&mut foo);
|
||||||
assert_eq!(foo.a, 5);
|
assert_eq!(foo.a, 5);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ struct E {
|
|||||||
|
|
||||||
impl A for E {
|
impl A for E {
|
||||||
fn b<F,G>(&self, _x: F) -> F { panic!() }
|
fn b<F,G>(&self, _x: F) -> F { panic!() }
|
||||||
//~^ ERROR in method `b`, type parameter 0 has 1 bound, but
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![allow(unused_variables)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
macro_rules! piece(
|
macro_rules! piece(
|
||||||
($piece:pat) => ($piece);
|
($piece:pat) => ($piece);
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![allow(unreachable_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
fn test() {
|
fn test() {
|
||||||
let _v: isize;
|
let _v: isize;
|
||||||
_v = 1;
|
_v = 1;
|
||||||
return;
|
return;
|
||||||
_v = 2; //~ WARNING: unreachable statement
|
_v = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|||||||
@@ -9,14 +9,14 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
|
||||||
#![allow(unreachable_code)]
|
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
fn id(x: bool) -> bool { x }
|
fn id(x: bool) -> bool { x }
|
||||||
|
|
||||||
fn call_id() {
|
fn call_id() {
|
||||||
let c = panic!();
|
let c = panic!();
|
||||||
id(c); //~ WARNING unreachable statement
|
id(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_id_3() { id(return) && id(return); }
|
fn call_id_3() { id(return) && id(return); }
|
||||||
|
|||||||
@@ -197,6 +197,11 @@ impl<'test> TestCx<'test> {
|
|||||||
self.fatal_proc_rec("compilation failed!", &proc_res);
|
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();
|
let proc_res = self.exec_compiled_test();
|
||||||
|
|
||||||
if !proc_res.status.success() {
|
if !proc_res.status.success() {
|
||||||
@@ -992,7 +997,8 @@ actual:\n\
|
|||||||
fn check_expected_errors(&self,
|
fn check_expected_errors(&self,
|
||||||
expected_errors: Vec<errors::Error>,
|
expected_errors: Vec<errors::Error>,
|
||||||
proc_res: &ProcRes) {
|
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);
|
self.fatal_proc_rec("process did not return an error status", proc_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1320,6 +1326,7 @@ actual:\n\
|
|||||||
match self.config.mode {
|
match self.config.mode {
|
||||||
CompileFail |
|
CompileFail |
|
||||||
ParseFail |
|
ParseFail |
|
||||||
|
RunPass |
|
||||||
Incremental => {
|
Incremental => {
|
||||||
// If we are extracting and matching errors in the new
|
// If we are extracting and matching errors in the new
|
||||||
// fashion, then you want JSON mode. Old-skool error
|
// fashion, then you want JSON mode. Old-skool error
|
||||||
@@ -1350,7 +1357,6 @@ actual:\n\
|
|||||||
args.push(dir_opt);
|
args.push(dir_opt);
|
||||||
}
|
}
|
||||||
RunFail |
|
RunFail |
|
||||||
RunPass |
|
|
||||||
RunPassValgrind |
|
RunPassValgrind |
|
||||||
Pretty |
|
Pretty |
|
||||||
DebugInfoGdb |
|
DebugInfoGdb |
|
||||||
|
|||||||
Reference in New Issue
Block a user