1
1
#[ test]
2
- fn dogfood ( ) {
2
+ fn dogfood_clippy ( ) {
3
+ // run clippy on itself and fail the test if lint warnings are reported
3
4
if option_env ! ( "RUSTC_TEST_SUITE" ) . is_some ( ) || cfg ! ( windows) {
4
5
return ;
5
6
}
6
7
let root_dir = std:: path:: PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
7
- let clippy_cmd = std:: path:: Path :: new ( & root_dir)
8
+ let clippy_binary = std:: path:: Path :: new ( & root_dir)
8
9
. join ( "target" )
9
10
. join ( env ! ( "PROFILE" ) )
10
11
. join ( "cargo-clippy" ) ;
11
12
12
- let output = std:: process:: Command :: new ( clippy_cmd )
13
+ let output = std:: process:: Command :: new ( clippy_binary )
13
14
. current_dir ( root_dir)
14
15
. env ( "CLIPPY_DOGFOOD" , "1" )
16
+ . env ( "CARGO_INCREMENTAL" , "0" )
15
17
. arg ( "clippy-preview" )
16
18
. arg ( "--all-targets" )
17
19
. arg ( "--all-features" )
18
20
. arg ( "--" )
19
21
. args ( & [ "-D" , "clippy::all" ] )
20
22
. args ( & [ "-D" , "clippy::internal" ] )
21
23
. args ( & [ "-D" , "clippy::pedantic" ] )
24
+ . arg ( "-Cdebuginfo=0" ) // disable debuginfo to generate less data in the target dir
22
25
. output ( )
23
26
. unwrap ( ) ;
24
27
println ! ( "status: {}" , output. status) ;
@@ -29,12 +32,13 @@ fn dogfood() {
29
32
}
30
33
31
34
#[ test]
32
- fn dogfood_tests ( ) {
35
+ fn dogfood_subprojects ( ) {
36
+ // run clippy on remaining subprojects and fail the test if lint warnings are reported
33
37
if option_env ! ( "RUSTC_TEST_SUITE" ) . is_some ( ) || cfg ! ( windows) {
34
38
return ;
35
39
}
36
40
let root_dir = std:: path:: PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
37
- let clippy_cmd = std:: path:: Path :: new ( & root_dir)
41
+ let clippy_binary = std:: path:: Path :: new ( & root_dir)
38
42
. join ( "target" )
39
43
. join ( env ! ( "PROFILE" ) )
40
44
. join ( "cargo-clippy" ) ;
@@ -47,13 +51,15 @@ fn dogfood_tests() {
47
51
"clippy_dev" ,
48
52
"rustc_tools_util" ,
49
53
] {
50
- let output = std:: process:: Command :: new ( & clippy_cmd )
54
+ let output = std:: process:: Command :: new ( & clippy_binary )
51
55
. current_dir ( root_dir. join ( d) )
52
56
. env ( "CLIPPY_DOGFOOD" , "1" )
57
+ . env ( "CARGO_INCREMENTAL" , "0" )
53
58
. arg ( "clippy" )
54
59
. arg ( "--" )
55
60
. args ( & [ "-D" , "clippy::all" ] )
56
61
. args ( & [ "-D" , "clippy::pedantic" ] )
62
+ . arg ( "-Cdebuginfo=0" ) // disable debuginfo to generate less data in the target dir
57
63
. output ( )
58
64
. unwrap ( ) ;
59
65
println ! ( "status: {}" , output. status) ;
0 commit comments