@@ -179,7 +179,7 @@ fn include_only_the_binary_from_the_current_package() {
179
179
}
180
180
181
181
#[ cargo_test]
182
- fn out_dir_is_a_file ( ) {
182
+ fn artifact_dir_is_a_file ( ) {
183
183
let p = project ( )
184
184
. file ( "src/main.rs" , r#"fn main() { println!("Hello, World!") }"# )
185
185
. file ( "out" , "" )
@@ -256,7 +256,7 @@ fn avoid_build_scripts() {
256
256
}
257
257
258
258
#[ cargo_test]
259
- fn cargo_build_out_dir ( ) {
259
+ fn cargo_build_artifact_dir ( ) {
260
260
let p = project ( )
261
261
. file ( "src/main.rs" , r#"fn main() { println!("Hello, World!") }"# )
262
262
. file (
@@ -282,7 +282,7 @@ fn cargo_build_out_dir() {
282
282
}
283
283
284
284
#[ cargo_test]
285
- fn unsupported_short_out_dir_flag ( ) {
285
+ fn unsupported_short_artifact_dir_flag ( ) {
286
286
let p = project ( )
287
287
. file ( "src/main.rs" , r#"fn main() { println!("Hello, World!") }"# )
288
288
. build ( ) ;
@@ -304,8 +304,57 @@ For more information, try '--help'.
304
304
. run ( ) ;
305
305
}
306
306
307
+ #[ cargo_test]
308
+ fn deprecated_out_dir ( ) {
309
+ let p = project ( )
310
+ . file ( "src/main.rs" , r#"fn main() { println!("Hello, World!") }"# )
311
+ . build ( ) ;
312
+
313
+ p. cargo ( "build -Z unstable-options --out-dir out" )
314
+ . masquerade_as_nightly_cargo ( & [ "out-dir" ] )
315
+ . enable_mac_dsym ( )
316
+ . with_stderr_contains ( "[WARNING] the --out-dir flag has been changed to --artifact-dir" )
317
+ . run ( ) ;
318
+ check_dir_contents (
319
+ & p. root ( ) . join ( "out" ) ,
320
+ & [ "foo" ] ,
321
+ & [ "foo" , "foo.dSYM" ] ,
322
+ & [ "foo.exe" , "foo.pdb" ] ,
323
+ & [ "foo.exe" ] ,
324
+ ) ;
325
+ }
326
+
327
+ #[ cargo_test]
328
+ fn cargo_build_deprecated_out_dir ( ) {
329
+ let p = project ( )
330
+ . file ( "src/main.rs" , r#"fn main() { println!("Hello, World!") }"# )
331
+ . file (
332
+ ".cargo/config.toml" ,
333
+ r#"
334
+ [build]
335
+ out-dir = "out"
336
+ "# ,
337
+ )
338
+ . build ( ) ;
339
+
340
+ p. cargo ( "build -Z unstable-options" )
341
+ . masquerade_as_nightly_cargo ( & [ "out-dir" ] )
342
+ . enable_mac_dsym ( )
343
+ . with_stderr_contains (
344
+ "[WARNING] the out-dir config option has been changed to artifact-dir" ,
345
+ )
346
+ . run ( ) ;
347
+ check_dir_contents (
348
+ & p. root ( ) . join ( "out" ) ,
349
+ & [ "foo" ] ,
350
+ & [ "foo" , "foo.dSYM" ] ,
351
+ & [ "foo.exe" , "foo.pdb" ] ,
352
+ & [ "foo.exe" ] ,
353
+ ) ;
354
+ }
355
+
307
356
fn check_dir_contents (
308
- out_dir : & Path ,
357
+ artifact_dir : & Path ,
309
358
expected_linux : & [ & str ] ,
310
359
expected_mac : & [ & str ] ,
311
360
expected_win_msvc : & [ & str ] ,
@@ -323,7 +372,7 @@ fn check_dir_contents(
323
372
expected_linux
324
373
} ;
325
374
326
- let actual = list_dir ( out_dir ) ;
375
+ let actual = list_dir ( artifact_dir ) ;
327
376
let mut expected = expected. iter ( ) . map ( |s| s. to_string ( ) ) . collect :: < Vec < _ > > ( ) ;
328
377
expected. sort_unstable ( ) ;
329
378
assert_eq ! ( actual, expected) ;
0 commit comments