@@ -1193,7 +1193,7 @@ fn simple_deps_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
1193
1193
}
1194
1194
1195
1195
#[ test]
1196
- fn simple_deps_cleaner_dose_not_rebuild ( ) {
1196
+ fn simple_deps_cleaner_does_not_rebuild ( ) {
1197
1197
let p = project ( )
1198
1198
. file (
1199
1199
"Cargo.toml" ,
@@ -1211,8 +1211,11 @@ fn simple_deps_cleaner_dose_not_rebuild() {
1211
1211
. file ( "bar/src/lib.rs" , "" )
1212
1212
. build ( ) ;
1213
1213
1214
- p. cargo ( "build" ) . run ( ) ;
1215
- p. cargo ( "build" )
1214
+ p. cargo ( "build -Z mtime-on-use" )
1215
+ . masquerade_as_nightly_cargo ( )
1216
+ . run ( ) ;
1217
+ p. cargo ( "build -Z mtime-on-use" )
1218
+ . masquerade_as_nightly_cargo ( )
1216
1219
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1217
1220
. with_stderr (
1218
1221
"\
@@ -1228,19 +1231,22 @@ fn simple_deps_cleaner_dose_not_rebuild() {
1228
1231
if is_coarse_mtime ( ) {
1229
1232
sleep_ms ( 1000 ) ;
1230
1233
}
1231
- // This dose not make new files, but it dose update the mtime.
1232
- p. cargo ( "build" )
1234
+ // This does not make new files, but it does update the mtime.
1235
+ p. cargo ( "build -Z mtime-on-use" )
1236
+ . masquerade_as_nightly_cargo ( )
1233
1237
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1234
1238
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1235
1239
. run ( ) ;
1236
1240
simple_deps_cleaner ( p. target_debug_dir ( ) , timestamp) ;
1237
1241
// This should not recompile!
1238
- p. cargo ( "build" )
1242
+ p. cargo ( "build -Z mtime-on-use" )
1243
+ . masquerade_as_nightly_cargo ( )
1239
1244
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1240
1245
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1241
1246
. run ( ) ;
1242
1247
// But this should be cleaned and so need a rebuild
1243
- p. cargo ( "build" )
1248
+ p. cargo ( "build -Z mtime-on-use" )
1249
+ . masquerade_as_nightly_cargo ( )
1244
1250
. with_stderr (
1245
1251
"\
1246
1252
[COMPILING] bar v0.0.1 ([..])
@@ -1282,7 +1288,7 @@ fn fingerprint_cleaner(mut dir: PathBuf, timestamp: filetime::FileTime) {
1282
1288
}
1283
1289
1284
1290
#[ test]
1285
- fn fingerprint_cleaner_dose_not_rebuild ( ) {
1291
+ fn fingerprint_cleaner_does_not_rebuild ( ) {
1286
1292
let p = project ( )
1287
1293
. file (
1288
1294
"Cargo.toml" ,
@@ -1300,8 +1306,11 @@ fn fingerprint_cleaner_dose_not_rebuild() {
1300
1306
. file ( "bar/src/lib.rs" , "" )
1301
1307
. build ( ) ;
1302
1308
1303
- p. cargo ( "build" ) . run ( ) ;
1304
- p. cargo ( "build" )
1309
+ p. cargo ( "build -Z mtime-on-use" )
1310
+ . masquerade_as_nightly_cargo ( )
1311
+ . run ( ) ;
1312
+ p. cargo ( "build -Z mtime-on-use" )
1313
+ . masquerade_as_nightly_cargo ( )
1305
1314
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1306
1315
. with_stderr (
1307
1316
"\
@@ -1317,19 +1326,22 @@ fn fingerprint_cleaner_dose_not_rebuild() {
1317
1326
if is_coarse_mtime ( ) {
1318
1327
sleep_ms ( 1000 ) ;
1319
1328
}
1320
- // This dose not make new files, but it dose update the mtime.
1321
- p. cargo ( "build" )
1329
+ // This does not make new files, but it does update the mtime.
1330
+ p. cargo ( "build -Z mtime-on-use" )
1331
+ . masquerade_as_nightly_cargo ( )
1322
1332
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1323
1333
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1324
1334
. run ( ) ;
1325
1335
fingerprint_cleaner ( p. target_debug_dir ( ) , timestamp) ;
1326
1336
// This should not recompile!
1327
- p. cargo ( "build" )
1337
+ p. cargo ( "build -Z mtime-on-use" )
1338
+ . masquerade_as_nightly_cargo ( )
1328
1339
. env ( "RUSTFLAGS" , "-C target-cpu=native" )
1329
1340
. with_stderr ( "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]" )
1330
1341
. run ( ) ;
1331
1342
// But this should be cleaned and so need a rebuild
1332
- p. cargo ( "build" )
1343
+ p. cargo ( "build -Z mtime-on-use" )
1344
+ . masquerade_as_nightly_cargo ( )
1333
1345
. with_stderr (
1334
1346
"\
1335
1347
[COMPILING] bar v0.0.1 ([..])
0 commit comments