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