Skip to content

Commit 55ea081

Browse files
authored
Merge pull request #1543 from Manishearth/fix-windows-tests
fix windows tests
2 parents f07f793 + 3fa1cd9 commit 55ea081

18 files changed

+41
-1
lines changed

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ environment:
44
matrix:
55
- TARGET: i686-pc-windows-gnu
66
MSYS2_BITS: 32
7+
RUN_CARGO_CLIPPY: true
78
- TARGET: i686-pc-windows-msvc
89
MSYS2_BITS: 32
10+
RUN_CARGO_CLIPPY: true
911
- TARGET: x86_64-pc-windows-gnu
1012
MSYS2_BITS: 64
1113
- TARGET: x86_64-pc-windows-msvc
@@ -22,11 +24,12 @@ install:
2224
build: false
2325

2426
test_script:
27+
- set RUST_BACKTRACE=1
2528
- cargo build --features debugging
2629
- cargo test --features debugging
2730
- copy target\debug\cargo-clippy.exe C:\Users\appveyor\.cargo\bin\
2831
- cargo clippy -- -D clippy
29-
- cd clippy_lints && cargo clippy -- -D clippy && cd ..
32+
- if defined RUN_CARGO_CLIPPY cd clippy_lints && cargo clippy -- -D clippy && cd ..
3033

3134
notifications:
3235
- provider: Email

tests/compile-test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ fn compile_test() {
2929
prepare_env();
3030
run_mode("run-pass", "run-pass");
3131
run_mode("ui", "ui");
32+
#[cfg(target_os = "windows")]
33+
run_mode("ui-windows", "ui");
34+
#[cfg(not(target_os = "windows"))]
35+
run_mode("ui-posix", "ui");
3236
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/ui-windows/conf_bad_toml.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// error-pattern: error reading Clippy's configuration file
2+
3+
#![feature(plugin)]
4+
#![plugin(clippy(conf_file="./tests/compile-fail/conf_bad_toml.toml"))]
5+
6+
fn main() {}

tests/ui-windows/conf_bad_toml.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
error: error reading Clippy's configuration file: The system cannot find the file specified. (os error 2)
2+
3+
error: aborting due to previous error
4+

tests/ui-windows/conf_bad_toml.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fn this_is_obviously(not: a, toml: file) {
2+
}

tests/ui-windows/conf_bad_type.rs

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

tests/ui-windows/conf_bad_type.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
error: error reading Clippy's configuration file: The system cannot find the file specified. (os error 2)
2+
3+
error: aborting due to previous error
4+

tests/ui-windows/conf_bad_type.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blacklisted-names = 42

tests/ui-windows/conf_non_existant.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// error-pattern: error reading Clippy's configuration file
2+
3+
#![feature(plugin)]
4+
#![plugin(clippy(conf_file="./tests/auxiliary/non_existant_conf.toml"))]
5+
6+
fn main() {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
error: error reading Clippy's configuration file: The system cannot find the file specified. (os error 2)
2+
3+
error: aborting due to previous error
4+

0 commit comments

Comments
 (0)