fix windows tests

Windows has a different error message than POSIX, so the ui tests fail for the clippy-config-fail tests.
This commit splits those tests up in target-os specific subdirectories and extends compile-test.rs to
run either of them based on the target os. Here's hope we'll get a green appveyor build.
This commit is contained in:
Andre Bogus 2017-02-14 17:30:55 +01:00
parent 9a7597d5af
commit d904a01140
17 changed files with 35 additions and 0 deletions

View File

@ -29,4 +29,6 @@ fn compile_test() {
prepare_env();
run_mode("run-pass", "run-pass");
run_mode("ui", "ui");
#[cfg(target_os = "windows")] run_mode("ui-windows", "ui");
#[cfg(not(target_os = "windows"))] run_mode("ui-posix", "ui");
}

View File

@ -0,0 +1,6 @@
// error-pattern: error reading Clippy's configuration file
#![feature(plugin)]
#![plugin(clippy(conf_file="./tests/compile-fail/conf_bad_toml.toml"))]
fn main() {}

View File

@ -0,0 +1,4 @@
error: error reading Clippy's configuration file: The system cannot find the file specified. (os error 2)
error: aborting due to previous error

View File

@ -0,0 +1,2 @@
fn this_is_obviously(not: a, toml: file) {
}

View File

@ -0,0 +1,6 @@
// error-pattern: error reading Clippy's configuration file: `blacklisted-names` is expected to be a `Vec < String >` but is a `integer`
#![feature(plugin)]
#![plugin(clippy(conf_file="./tests/compile-fail/conf_bad_type.toml"))]
fn main() {}

View File

@ -0,0 +1,4 @@
error: error reading Clippy's configuration file: The system cannot find the file specified. (os error 2)
error: aborting due to previous error

View File

@ -0,0 +1 @@
blacklisted-names = 42

View File

@ -0,0 +1,6 @@
// error-pattern: error reading Clippy's configuration file
#![feature(plugin)]
#![plugin(clippy(conf_file="./tests/auxiliary/non_existant_conf.toml"))]
fn main() {}

View File

@ -0,0 +1,4 @@
error: error reading Clippy's configuration file: The system cannot find the file specified. (os error 2)
error: aborting due to previous error