@@ -5972,6 +5972,56 @@ fn build_with_relative_cargo_home_path() {
59725972 p. cargo ( "build" ) . env ( "CARGO_HOME" , "./cargo_home/" ) . run ( ) ;
59735973}
59745974
5975+ #[ cargo_test]
5976+ fn skip_mtime_check_in_selected_cargo_home_subdirs ( ) {
5977+ // Run once without cache
5978+ let p = project ( )
5979+ . at ( "cargo_home/registry/foo" )
5980+ . file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
5981+ . file ( "src/main.rs" , r#"fn main() { println!("1"); }"# )
5982+ . build ( ) ;
5983+ let project_root = p. root ( ) ;
5984+ let cargo_home = project_root
5985+ . parent ( ) . unwrap ( )
5986+ . parent ( ) . unwrap ( )
5987+ . to_str ( ) . unwrap ( ) ;
5988+ p. cargo ( "run" )
5989+ . env ( "CARGO_HOME" , & cargo_home)
5990+ . with_stdout ( "1" )
5991+ . run ( ) ;
5992+ // Run with cache
5993+ p. change_file ( "src/main.rs" , r#"fn main() { println!("2"); }"# ) ;
5994+ p. cargo ( "run" )
5995+ . env ( "CARGO_HOME" , & cargo_home)
5996+ . with_stdout ( "1" )
5997+ . run ( ) ;
5998+ }
5999+
6000+ #[ cargo_test]
6001+ fn use_mtime_cache_in_cargo_home ( ) {
6002+ println ! ( "Without cache" ) ;
6003+ let p = project ( )
6004+ . at ( "cargo_home/foo" )
6005+ . file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
6006+ . file ( "src/main.rs" , r#"fn main() { println!("1"); }"# )
6007+ . build ( ) ;
6008+ let project_root = p. root ( ) ;
6009+ let cargo_home = project_root
6010+ . parent ( ) . unwrap ( )
6011+ . parent ( ) . unwrap ( )
6012+ . to_str ( ) . unwrap ( ) ;
6013+ p. cargo ( "run" )
6014+ . env ( "CARGO_HOME" , & cargo_home)
6015+ . with_stdout ( "1" )
6016+ . run ( ) ;
6017+ println ! ( "With cache" ) ;
6018+ p. change_file ( "src/main.rs" , r#"fn main() { println!("2"); }"# ) ;
6019+ p. cargo ( "run" )
6020+ . env ( "CARGO_HOME" , & cargo_home)
6021+ . with_stdout ( "2" )
6022+ . run ( ) ;
6023+ }
6024+
59756025#[ cargo_test]
59766026fn user_specific_cfgs_are_filtered_out ( ) {
59776027 let p = project ( )
0 commit comments