Skip to content

Commit 3fe1d9c

Browse files
committed
Do the same things for fulldeps tests
1 parent 1f5b201 commit 3fe1d9c

File tree

9 files changed

+126
-6
lines changed

9 files changed

+126
-6
lines changed

src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs renamed to src/test/ui-fulldeps/lint-plugin-forbid-attrs.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@
1414
#![feature(plugin)]
1515
#![plugin(lint_plugin_test)]
1616
#![forbid(test_lint)]
17-
//~^ NOTE lint level defined here
18-
//~| NOTE `forbid` level set here
1917

2018
fn lintme() { } //~ ERROR item is named 'lintme'
2119

2220
#[allow(test_lint)]
2321
//~^ ERROR allow(test_lint) overruled by outer forbid(test_lint)
24-
//~| NOTE overruled by previous forbid
2522
pub fn main() {
2623
lintme();
2724
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error: item is named 'lintme'
2+
--> $DIR/lint-plugin-forbid-attrs.rs:18:1
3+
|
4+
18 | fn lintme() { } //~ ERROR item is named 'lintme'
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
note: lint level defined here
8+
--> $DIR/lint-plugin-forbid-attrs.rs:16:11
9+
|
10+
16 | #![forbid(test_lint)]
11+
| ^^^^^^^^^
12+
13+
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
14+
--> $DIR/lint-plugin-forbid-attrs.rs:20:9
15+
|
16+
16 | #![forbid(test_lint)]
17+
| --------- `forbid` level set here
18+
...
19+
20 | #[allow(test_lint)]
20+
| ^^^^^^^^^ overruled by previous forbid
21+
22+
error: aborting due to 2 previous errors
23+

src/test/compile-fail-fulldeps/proc-macro/load-panic.rs renamed to src/test/ui-fulldeps/proc-macro/load-panic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ extern crate derive_panic;
1515

1616
#[derive(A)]
1717
//~^ ERROR: proc-macro derive panicked
18-
//~| HELP: message: nope!
1918
struct Foo;
2019

2120
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: proc-macro derive panicked
2+
--> $DIR/load-panic.rs:16:10
3+
|
4+
16 | #[derive(A)]
5+
| ^
6+
|
7+
= help: message: nope!
8+

src/test/compile-fail-fulldeps/proc-macro/signature.rs renamed to src/test/ui-fulldeps/proc-macro/signature.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ extern crate proc_macro;
1616
#[proc_macro_derive(A)]
1717
pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
1818
//~^ ERROR: mismatched types
19-
//~| NOTE: expected normal fn, found unsafe fn
20-
//~| NOTE: expected type `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
2119
loop {}
2220
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/signature.rs:17:1
3+
|
4+
17 | / pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
5+
18 | | //~^ ERROR: mismatched types
6+
19 | | loop {}
7+
20 | | }
8+
| |_^ expected normal fn, found unsafe fn
9+
|
10+
= note: expected type `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
11+
found type `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
12+
13+
error: aborting due to previous error
14+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
4+
# file at the top-level directory of this distribution and at
5+
# http://rust-lang.org/COPYRIGHT.
6+
#
7+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
# option. This file may not be copied, modified, or distributed
11+
# except according to those terms.
12+
13+
# A script to update the references for all tests. The idea is that
14+
# you do a run, which will generate files in the build directory
15+
# containing the (normalized) actual output of the compiler. You then
16+
# run this script, which will copy those files over. If you find
17+
# yourself manually editing a foo.stderr file, you're doing it wrong.
18+
#
19+
# See all `update-references.sh`, if you just want to update a single test.
20+
21+
if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" != "" ]]; then
22+
echo "usage: $0 <build-directory>"
23+
echo ""
24+
echo "For example:"
25+
echo " $0 ../../../build/x86_64-apple-darwin/test/ui"
26+
fi
27+
28+
BUILD_DIR=$PWD/$1
29+
MY_DIR=$(dirname $0)
30+
cd $MY_DIR
31+
find . -name '*.rs' | xargs ./update-references.sh $BUILD_DIR
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
4+
# file at the top-level directory of this distribution and at
5+
# http://rust-lang.org/COPYRIGHT.
6+
#
7+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
# option. This file may not be copied, modified, or distributed
11+
# except according to those terms.
12+
13+
# A script to update the references for particular tests. The idea is
14+
# that you do a run, which will generate files in the build directory
15+
# containing the (normalized) actual output of the compiler. This
16+
# script will then copy that output and replace the "expected output"
17+
# files. You can then commit the changes.
18+
#
19+
# If you find yourself manually editing a foo.stderr file, you're
20+
# doing it wrong.
21+
22+
if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then
23+
echo "usage: $0 <build-directory> <relative-path-to-rs-files>"
24+
echo ""
25+
echo "For example:"
26+
echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs"
27+
fi
28+
29+
MYDIR=$(dirname $0)
30+
31+
BUILD_DIR="$1"
32+
shift
33+
34+
while [[ "$1" != "" ]]; do
35+
STDERR_NAME="${1/%.rs/.stderr}"
36+
STDOUT_NAME="${1/%.rs/.stdout}"
37+
shift
38+
if [ -f $BUILD_DIR/$STDOUT_NAME ] && \
39+
! (diff $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME >& /dev/null); then
40+
echo updating $MYDIR/$STDOUT_NAME
41+
cp $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME
42+
fi
43+
if [ -f $BUILD_DIR/$STDERR_NAME ] && \
44+
! (diff $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME >& /dev/null); then
45+
echo updating $MYDIR/$STDERR_NAME
46+
cp $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME
47+
fi
48+
done
49+
50+

0 commit comments

Comments
 (0)