test: Add a compile-fail-fulldeps test suite

Compile-fail tests for syntax extensions belong in this suite which has correct
dependencies on all artifacts rather than just the target artifacts.

Closes #13818
This commit is contained in:
Alex Crichton 2014-04-28 17:31:43 -07:00
parent a3b28cb1f8
commit 7b2a89fa75
10 changed files with 13 additions and 1 deletions

View file

@ -1,22 +0,0 @@
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-stage1
// ignore-pretty
#![feature(phase)]
#[phase(syntax)]
extern crate fourcc;
fn main() {
let val = fourcc!("foo"); //~ ERROR string literal with len != 4 in fourcc!
let val2 = fourcc!("fooba"); //~ ERROR string literal with len != 4 in fourcc!
}

View file

@ -1,21 +0,0 @@
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-stage1
// ignore-pretty
#![feature(phase)]
#[phase(syntax)]
extern crate fourcc;
fn main() {
let val = fourcc!("foo ", bork); //~ ERROR invalid endian directive in fourcc!
}

View file

@ -1,21 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-stage1
// ignore-pretty
#![feature(phase)]
#[phase(syntax)]
extern crate fourcc;
fn main() {
let v = fourcc!("fooλ"); //~ ERROR fourcc! literal character out of range 0-255
}

View file

@ -1,21 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-stage1
// ignore-pretty
#![feature(phase)]
#[phase(syntax)]
extern crate fourcc;
fn main() {
let val = fourcc!(foo); //~ ERROR non-literal in fourcc!
}

View file

@ -1,21 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-stage1
// ignore-pretty
#![feature(phase)]
#[phase(syntax)]
extern crate fourcc;
fn main() {
let val = fourcc!(45f32); //~ ERROR unsupported literal in fourcc!
}

View file

@ -1,34 +0,0 @@
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-stage1
// ignore-pretty
#![feature(phase)]
#[phase(syntax)]
extern crate hexfloat;
fn main() {
hexfloat!("foo");
//~^ ERROR invalid hex float literal in hexfloat!: Expected '0'
hexfloat!("0");
//~^ERROR invalid hex float literal in hexfloat!: Expected 'x'
hexfloat!("0x");
//~^ERROR invalid hex float literal in hexfloat!: Expected '.'
hexfloat!("0x.");
//~^ERROR invalid hex float literal in hexfloat!: Expected digits before or after decimal point
hexfloat!("0x0.0");
//~^ERROR invalid hex float literal in hexfloat!: Expected 'p'
hexfloat!("0x0.0p");
//~^ERROR invalid hex float literal in hexfloat!: Expected exponent digits
hexfloat!("0x0.0p0f");
//~^ERROR invalid hex float literal in hexfloat!: Expected end of string
}

View file

@ -1,26 +0,0 @@
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-stage1
// ignore-pretty
#![feature(phase)]
#[phase(syntax)]
extern crate hexfloat;
fn main() {
hexfloat!(foo);
//~^ ERROR non-literal in hexfloat!
hexfloat!(0);
//~^ ERROR unsupported literal in hexfloat!
hexfloat!("0x0.p0", invalid);
//~^ ERROR invalid floating point type in hexfloat!
}

View file

@ -1,28 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// FIXME(#13725) windows needs fixing.
// ignore-win32
// ignore-stage1
#![feature(phase)]
extern crate regex;
#[phase(syntax)] extern crate regex_macros;
// Tests to make sure that `regex!` will produce a compile error when given
// an invalid regular expression.
// More exhaustive failure tests for the parser are done with the traditional
// unit testing infrastructure, since both dynamic and native regexes use the
// same parser.
fn main() {
let _ = regex!("("); //~ ERROR Regex syntax error
}