diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-03-02 14:25:25 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-03-02 14:26:28 -0500 |
| commit | fff9c2b6db70e0bb895fc0d1e207566345f098c5 (patch) | |
| tree | 3fe1fe90bd02c348ad3278fa7b09f59713f004e5 /src/test | |
| parent | ad3ed805030a128d83349cbf3c2dfab15c8a61a7 (diff) | |
add a run-fail meta test
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-fail/meta-revision-bad.rs | 22 | ||||
| -rw-r--r-- | src/test/run-fail/meta-revision-ok.rs | 21 |
2 files changed, 43 insertions, 0 deletions
diff --git a/src/test/run-fail/meta-revision-bad.rs b/src/test/run-fail/meta-revision-bad.rs new file mode 100644 index 00000000000..bf521d4b4e5 --- /dev/null +++ b/src/test/run-fail/meta-revision-bad.rs @@ -0,0 +1,22 @@ +// Copyright 2012 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. + +// Meta test for compiletest: check that when we give the wrong error +// patterns, the test fails. + +// revisions: foo bar +// should-fail +//[foo] error-pattern:bar +//[bar] error-pattern:foo + +#[cfg(foo)] fn die() {panic!("foo");} +#[cfg(bar)] fn die() {panic!("bar");} + +fn main() { die(); } diff --git a/src/test/run-fail/meta-revision-ok.rs b/src/test/run-fail/meta-revision-ok.rs new file mode 100644 index 00000000000..f74ec39fdf2 --- /dev/null +++ b/src/test/run-fail/meta-revision-ok.rs @@ -0,0 +1,21 @@ +// Copyright 2012 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. + +// Meta test for compiletest: check that when we give the right error +// patterns, the test passes. See all `meta-revision-bad.rs`. + +// revisions: foo bar +//[foo] error-pattern:foo +//[bar] error-pattern:bar + +#[cfg(foo)] fn die() {panic!("foo");} +#[cfg(bar)] fn die() {panic!("bar");} + +fn main() { die(); } |
