about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-12-11 00:00:10 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-12-14 23:26:40 +0300
commit3fe1d9c52445cb5cbb5bd9424ec1f8d6cc65a29f (patch)
tree0aee3f1951d6ade117cf4c59ef0db61621cd0ed0
parent1f5b201affc48dcf0b637caa9596c11d83e1db94 (diff)
downloadrust-3fe1d9c52445cb5cbb5bd9424ec1f8d6cc65a29f.tar.gz
rust-3fe1d9c52445cb5cbb5bd9424ec1f8d6cc65a29f.zip
Do the same things for fulldeps tests
-rw-r--r--src/test/ui-fulldeps/lint-plugin-forbid-attrs.rs (renamed from src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs)3
-rw-r--r--src/test/ui-fulldeps/lint-plugin-forbid-attrs.stderr23
-rw-r--r--src/test/ui-fulldeps/proc-macro/auxiliary/derive-panic.rs (renamed from src/test/compile-fail-fulldeps/proc-macro/auxiliary/derive-panic.rs)0
-rw-r--r--src/test/ui-fulldeps/proc-macro/load-panic.rs (renamed from src/test/compile-fail-fulldeps/proc-macro/load-panic.rs)1
-rw-r--r--src/test/ui-fulldeps/proc-macro/load-panic.stderr8
-rw-r--r--src/test/ui-fulldeps/proc-macro/signature.rs (renamed from src/test/compile-fail-fulldeps/proc-macro/signature.rs)2
-rw-r--r--src/test/ui-fulldeps/proc-macro/signature.stderr14
-rw-r--r--src/test/ui-fulldeps/update-all-references.sh31
-rw-r--r--src/test/ui-fulldeps/update-references.sh50
9 files changed, 126 insertions, 6 deletions
diff --git a/src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs b/src/test/ui-fulldeps/lint-plugin-forbid-attrs.rs
index 75a025f0648..21b8057431b 100644
--- a/src/test/compile-fail-fulldeps/lint-plugin-forbid-attrs.rs
+++ b/src/test/ui-fulldeps/lint-plugin-forbid-attrs.rs
@@ -14,14 +14,11 @@
 #![feature(plugin)]
 #![plugin(lint_plugin_test)]
 #![forbid(test_lint)]
-//~^ NOTE lint level defined here
-//~| NOTE `forbid` level set here
 
 fn lintme() { } //~ ERROR item is named 'lintme'
 
 #[allow(test_lint)]
 //~^ ERROR allow(test_lint) overruled by outer forbid(test_lint)
-//~| NOTE overruled by previous forbid
 pub fn main() {
     lintme();
 }
diff --git a/src/test/ui-fulldeps/lint-plugin-forbid-attrs.stderr b/src/test/ui-fulldeps/lint-plugin-forbid-attrs.stderr
new file mode 100644
index 00000000000..459be9db578
--- /dev/null
+++ b/src/test/ui-fulldeps/lint-plugin-forbid-attrs.stderr
@@ -0,0 +1,23 @@
+error: item is named 'lintme'
+  --> $DIR/lint-plugin-forbid-attrs.rs:18:1
+   |
+18 | fn lintme() { } //~ ERROR item is named 'lintme'
+   | ^^^^^^^^^^^^^^^
+   |
+note: lint level defined here
+  --> $DIR/lint-plugin-forbid-attrs.rs:16:11
+   |
+16 | #![forbid(test_lint)]
+   |           ^^^^^^^^^
+
+error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
+  --> $DIR/lint-plugin-forbid-attrs.rs:20:9
+   |
+16 | #![forbid(test_lint)]
+   |           --------- `forbid` level set here
+...
+20 | #[allow(test_lint)]
+   |         ^^^^^^^^^ overruled by previous forbid
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/compile-fail-fulldeps/proc-macro/auxiliary/derive-panic.rs b/src/test/ui-fulldeps/proc-macro/auxiliary/derive-panic.rs
index 3274f0324e1..3274f0324e1 100644
--- a/src/test/compile-fail-fulldeps/proc-macro/auxiliary/derive-panic.rs
+++ b/src/test/ui-fulldeps/proc-macro/auxiliary/derive-panic.rs
diff --git a/src/test/compile-fail-fulldeps/proc-macro/load-panic.rs b/src/test/ui-fulldeps/proc-macro/load-panic.rs
index c483c048b41..328f398efd5 100644
--- a/src/test/compile-fail-fulldeps/proc-macro/load-panic.rs
+++ b/src/test/ui-fulldeps/proc-macro/load-panic.rs
@@ -15,7 +15,6 @@ extern crate derive_panic;
 
 #[derive(A)]
 //~^ ERROR: proc-macro derive panicked
-//~| HELP: message: nope!
 struct Foo;
 
 fn main() {}
diff --git a/src/test/ui-fulldeps/proc-macro/load-panic.stderr b/src/test/ui-fulldeps/proc-macro/load-panic.stderr
new file mode 100644
index 00000000000..1be1609d45b
--- /dev/null
+++ b/src/test/ui-fulldeps/proc-macro/load-panic.stderr
@@ -0,0 +1,8 @@
+error: proc-macro derive panicked
+  --> $DIR/load-panic.rs:16:10
+   |
+16 | #[derive(A)]
+   |          ^
+   |
+   = help: message: nope!
+
diff --git a/src/test/compile-fail-fulldeps/proc-macro/signature.rs b/src/test/ui-fulldeps/proc-macro/signature.rs
index e249c9e9aa2..f2ea6f778cd 100644
--- a/src/test/compile-fail-fulldeps/proc-macro/signature.rs
+++ b/src/test/ui-fulldeps/proc-macro/signature.rs
@@ -16,7 +16,5 @@ extern crate proc_macro;
 #[proc_macro_derive(A)]
 pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
     //~^ ERROR: mismatched types
-    //~| NOTE: expected normal fn, found unsafe fn
-    //~| NOTE: expected type `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
     loop {}
 }
diff --git a/src/test/ui-fulldeps/proc-macro/signature.stderr b/src/test/ui-fulldeps/proc-macro/signature.stderr
new file mode 100644
index 00000000000..2beb0aac862
--- /dev/null
+++ b/src/test/ui-fulldeps/proc-macro/signature.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+  --> $DIR/signature.rs:17:1
+   |
+17 | / pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
+18 | |     //~^ ERROR: mismatched types
+19 | |     loop {}
+20 | | }
+   | |_^ expected normal fn, found unsafe fn
+   |
+   = note: expected type `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
+              found type `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui-fulldeps/update-all-references.sh b/src/test/ui-fulldeps/update-all-references.sh
new file mode 100644
index 00000000000..bfc6f923f9d
--- /dev/null
+++ b/src/test/ui-fulldeps/update-all-references.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+#
+# Copyright 2015 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.
+
+# A script to update the references for all tests. The idea is that
+# you do a run, which will generate files in the build directory
+# containing the (normalized) actual output of the compiler. You then
+# run this script, which will copy those files over. If you find
+# yourself manually editing a foo.stderr file, you're doing it wrong.
+#
+# See all `update-references.sh`, if you just want to update a single test.
+
+if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" != "" ]]; then
+    echo "usage: $0 <build-directory>"
+    echo ""
+    echo "For example:"
+    echo "   $0 ../../../build/x86_64-apple-darwin/test/ui"
+fi
+
+BUILD_DIR=$PWD/$1
+MY_DIR=$(dirname $0)
+cd $MY_DIR
+find . -name '*.rs' | xargs ./update-references.sh $BUILD_DIR
diff --git a/src/test/ui-fulldeps/update-references.sh b/src/test/ui-fulldeps/update-references.sh
new file mode 100644
index 00000000000..b9ded7d1e95
--- /dev/null
+++ b/src/test/ui-fulldeps/update-references.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+#
+# Copyright 2015 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.
+
+# A script to update the references for particular tests. The idea is
+# that you do a run, which will generate files in the build directory
+# containing the (normalized) actual output of the compiler. This
+# script will then copy that output and replace the "expected output"
+# files. You can then commit the changes.
+#
+# If you find yourself manually editing a foo.stderr file, you're
+# doing it wrong.
+
+if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then
+    echo "usage: $0 <build-directory> <relative-path-to-rs-files>"
+    echo ""
+    echo "For example:"
+    echo "   $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs"
+fi
+
+MYDIR=$(dirname $0)
+
+BUILD_DIR="$1"
+shift
+
+while [[ "$1" != "" ]]; do
+    STDERR_NAME="${1/%.rs/.stderr}"
+    STDOUT_NAME="${1/%.rs/.stdout}"
+    shift
+    if [ -f $BUILD_DIR/$STDOUT_NAME ] && \
+           ! (diff $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME >& /dev/null); then
+        echo updating $MYDIR/$STDOUT_NAME
+        cp $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME
+    fi
+    if [ -f $BUILD_DIR/$STDERR_NAME ] && \
+           ! (diff $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME >& /dev/null); then
+        echo updating $MYDIR/$STDERR_NAME
+        cp $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME
+    fi
+done
+
+