forked from rust-lang/rust-clippy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rust-lang#2825 from Nemo157/test-toml
Get compile-test tests for configuration working
- Loading branch information
Showing
19 changed files
with
197 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
error: error reading Clippy's configuration file `$DIR/clippy.toml`: expected an equals, found an identifier at line 1 | ||
|
||
error: aborting due to previous error | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
error: error reading Clippy's configuration file `$DIR/clippy.toml`: invalid type: integer `42`, expected a sequence | ||
|
||
error: aborting due to previous error | ||
|
File renamed without changes.
File renamed without changes.
46 changes: 46 additions & 0 deletions
46
tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
error: use of a blacklisted/placeholder name `toto` | ||
--> $DIR/conf_french_blacklisted_name.rs:9:9 | ||
| | ||
9 | fn test(toto: ()) {} | ||
| ^^^^ | ||
| | ||
= note: `-D blacklisted-name` implied by `-D warnings` | ||
|
||
error: use of a blacklisted/placeholder name `toto` | ||
--> $DIR/conf_french_blacklisted_name.rs:12:9 | ||
| | ||
12 | let toto = 42; | ||
| ^^^^ | ||
|
||
error: use of a blacklisted/placeholder name `tata` | ||
--> $DIR/conf_french_blacklisted_name.rs:13:9 | ||
| | ||
13 | let tata = 42; | ||
| ^^^^ | ||
|
||
error: use of a blacklisted/placeholder name `titi` | ||
--> $DIR/conf_french_blacklisted_name.rs:14:9 | ||
| | ||
14 | let titi = 42; | ||
| ^^^^ | ||
|
||
error: use of a blacklisted/placeholder name `toto` | ||
--> $DIR/conf_french_blacklisted_name.rs:20:10 | ||
| | ||
20 | (toto, Some(tata), titi @ Some(_)) => (), | ||
| ^^^^ | ||
|
||
error: use of a blacklisted/placeholder name `tata` | ||
--> $DIR/conf_french_blacklisted_name.rs:20:21 | ||
| | ||
20 | (toto, Some(tata), titi @ Some(_)) => (), | ||
| ^^^^ | ||
|
||
error: use of a blacklisted/placeholder name `titi` | ||
--> $DIR/conf_french_blacklisted_name.rs:20:28 | ||
| | ||
20 | (toto, Some(tata), titi @ Some(_)) => (), | ||
| ^^^^ | ||
|
||
error: aborting due to 7 previous errors | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown field `foobar`, expected one of `blacklisted-names`, `cyclomatic-complexity-threshold`, `doc-valid-idents`, `too-many-arguments-threshold`, `type-complexity-threshold`, `single-char-binding-names-threshold`, `too-large-for-stack`, `enum-variant-name-threshold`, `enum-variant-size-threshold`, `verbose-bit-mask-threshold`, `literal-representation-threshold`, `third-party` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/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" ]]; then | ||
echo "usage: $0" | ||
fi | ||
|
||
BUILD_DIR=$PWD/target/debug/test_build_base | ||
MY_DIR=$(dirname $0) | ||
cd $MY_DIR | ||
find . -name '*.rs' | xargs ./update-references.sh $BUILD_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/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 | ||
|
||
|
Empty file.
Empty file.
Empty file.
Empty file.