@@ -1204,7 +1204,7 @@ fn simple_deps_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
1204
1204
}
1205
1205
1206
1206
#[ test]
1207
- fn simple_deps_cleaner_dose_not_rebuild ( ) {
1207
+ fn simple_deps_cleaner_does_not_rebuild ( ) {
1208
1208
let p = project ( )
1209
1209
. file (
1210
1210
"Cargo.toml" ,
@@ -1222,8 +1222,11 @@ fn simple_deps_cleaner_dose_not_rebuild() {
1222
1222
. file ( "bar/src/lib.rs" , "" )
1223
1223
. build ( ) ;
1224
1224
1225
- p. cargo ( "build" ) . run ( ) ;
1226
- p. cargo ( "build" )
1225
+ p. cargo ( "build -Z mtime-on-use" )
1226
+ . masquerade_as_nightly_cargo ( )
1227
+ . run ( ) ;
1228
+ p. cargo ( "build -Z mtime-on-use" )
1229
+ . masquerade_as_nightly_cargo ( )
1227
1230
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1228
1231
. with_stderr (
1229
1232
"\
@@ -1239,19 +1242,22 @@ fn simple_deps_cleaner_dose_not_rebuild() {
1239
1242
if is_coarse_mtime ( ) {
1240
1243
sleep_ms ( 1000 ) ;
1241
1244
}
1242
- // This dose not make new files, but it dose update the mtime.
1243
- p. cargo ( "build" )
1245
+ // This does not make new files, but it does update the mtime.
1246
+ p. cargo ( "build -Z mtime-on-use" )
1247
+ . masquerade_as_nightly_cargo ( )
1244
1248
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1245
1249
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1246
1250
. run ( ) ;
1247
1251
simple_deps_cleaner ( p. target_debug_dir ( ) , timestamp) ;
1248
1252
// This should not recompile!
1249
- p. cargo ( "build" )
1253
+ p. cargo ( "build -Z mtime-on-use" )
1254
+ . masquerade_as_nightly_cargo ( )
1250
1255
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1251
1256
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1252
1257
. run ( ) ;
1253
1258
// But this should be cleaned and so need a rebuild
1254
- p. cargo ( "build" )
1259
+ p. cargo ( "build -Z mtime-on-use" )
1260
+ . masquerade_as_nightly_cargo ( )
1255
1261
. with_stderr (
1256
1262
"\
1257
1263
[COMPILING] bar v0.0.1 ([..])
@@ -1293,7 +1299,7 @@ fn fingerprint_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
1293
1299
}
1294
1300
1295
1301
#[ test]
1296
- fn fingerprint_cleaner_dose_not_rebuild ( ) {
1302
+ fn fingerprint_cleaner_does_not_rebuild ( ) {
1297
1303
let p = project ( )
1298
1304
. file (
1299
1305
"Cargo.toml" ,
@@ -1311,8 +1317,11 @@ fn fingerprint_cleaner_dose_not_rebuild() {
1311
1317
. file ( "bar/src/lib.rs" , "" )
1312
1318
. build ( ) ;
1313
1319
1314
- p. cargo ( "build" ) . run ( ) ;
1315
- p. cargo ( "build" )
1320
+ p. cargo ( "build -Z mtime-on-use" )
1321
+ . masquerade_as_nightly_cargo ( )
1322
+ . run ( ) ;
1323
+ p. cargo ( "build -Z mtime-on-use" )
1324
+ . masquerade_as_nightly_cargo ( )
1316
1325
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1317
1326
. with_stderr (
1318
1327
"\
@@ -1328,19 +1337,22 @@ fn fingerprint_cleaner_dose_not_rebuild() {
1328
1337
if is_coarse_mtime ( ) {
1329
1338
sleep_ms ( 1000 ) ;
1330
1339
}
1331
- // This dose not make new files, but it dose update the mtime.
1332
- p. cargo ( "build" )
1340
+ // This does not make new files, but it does update the mtime.
1341
+ p. cargo ( "build -Z mtime-on-use" )
1342
+ . masquerade_as_nightly_cargo ( )
1333
1343
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1334
1344
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1335
1345
. run ( ) ;
1336
1346
fingerprint_cleaner ( p. target_debug_dir ( ) , timestamp) ;
1337
1347
// This should not recompile!
1338
- p. cargo ( "build" )
1348
+ p. cargo ( "build -Z mtime-on-use" )
1349
+ . masquerade_as_nightly_cargo ( )
1339
1350
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1340
1351
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1341
1352
. run ( ) ;
1342
1353
// But this should be cleaned and so need a rebuild
1343
- p. cargo ( "build" )
1354
+ p. cargo ( "build -Z mtime-on-use" )
1355
+ . masquerade_as_nightly_cargo ( )
1344
1356
. with_stderr (
1345
1357
"\
1346
1358
[COMPILING] bar v0.0.1 ([..])
0 commit comments