11#[ test]
2- fn dogfood ( ) {
2+ fn dogfood_clippy ( ) {
3+ // run clippy on itself and fail the test if lint warnings are reported
34 if option_env ! ( "RUSTC_TEST_SUITE" ) . is_some ( ) || cfg ! ( windows) {
45 return ;
56 }
67 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)
89 . join ( "target" )
910 . join ( env ! ( "PROFILE" ) )
1011 . join ( "cargo-clippy" ) ;
1112
12- let output = std:: process:: Command :: new ( clippy_cmd )
13+ let output = std:: process:: Command :: new ( clippy_binary )
1314 . current_dir ( root_dir)
1415 . env ( "CLIPPY_DOGFOOD" , "1" )
1516 . env ( "CARGO_INCREMENTAL" , "0" )
@@ -20,6 +21,7 @@ fn dogfood() {
2021 . args ( & [ "-D" , "clippy::all" ] )
2122 . args ( & [ "-D" , "clippy::internal" ] )
2223 . args ( & [ "-D" , "clippy::pedantic" ] )
24+ . arg ( "-Cdebuginfo=0" ) // disable debuginfo to generate less data in the target dir
2325 . output ( )
2426 . unwrap ( ) ;
2527 println ! ( "status: {}" , output. status) ;
@@ -30,12 +32,13 @@ fn dogfood() {
3032}
3133
3234#[ test]
33- fn dogfood_tests ( ) {
35+ fn dogfood_subprojects ( ) {
36+ // run clippy on remaining subprojects and fail the test if lint warnings are reported
3437 if option_env ! ( "RUSTC_TEST_SUITE" ) . is_some ( ) || cfg ! ( windows) {
3538 return ;
3639 }
3740 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)
3942 . join ( "target" )
4043 . join ( env ! ( "PROFILE" ) )
4144 . join ( "cargo-clippy" ) ;
@@ -48,14 +51,15 @@ fn dogfood_tests() {
4851 "clippy_dev" ,
4952 "rustc_tools_util" ,
5053 ] {
51- let output = std:: process:: Command :: new ( & clippy_cmd )
54+ let output = std:: process:: Command :: new ( & clippy_binary )
5255 . current_dir ( root_dir. join ( d) )
5356 . env ( "CLIPPY_DOGFOOD" , "1" )
5457 . env ( "CARGO_INCREMENTAL" , "0" )
5558 . arg ( "clippy" )
5659 . arg ( "--" )
5760 . args ( & [ "-D" , "clippy::all" ] )
5861 . args ( & [ "-D" , "clippy::pedantic" ] )
62+ . arg ( "-Cdebuginfo=0" ) // disable debuginfo to generate less data in the target dir
5963 . output ( )
6064 . unwrap ( ) ;
6165 println ! ( "status: {}" , output. status) ;
0 commit comments