@@ -453,29 +453,61 @@ fn diagnostics_works() {
453
453
}
454
454
455
455
#[ cfg( target_os = "macos" ) ]
456
- #[ cargo_test( requires_nm, nightly, reason = "-Zremap-path-scope is unstable" ) ]
457
- fn object_works ( ) {
458
- object_works_helper ( "off" , |path| {
456
+ mod object_works {
457
+ use super :: * ;
458
+
459
+ fn inspect_debuginfo ( path : & std:: path:: Path ) -> Vec < u8 > {
459
460
std:: process:: Command :: new ( "nm" )
460
461
. arg ( "-pa" )
461
462
. arg ( path)
462
463
. output ( )
463
464
. expect ( "nm works" )
464
465
. stdout
465
- } )
466
+ }
467
+
468
+ #[ cargo_test( requires_nm, nightly, reason = "-Zremap-path-scope is unstable" ) ]
469
+ fn with_split_debuginfo_off ( ) {
470
+ object_works_helper ( "off" , inspect_debuginfo) ;
471
+ }
472
+
473
+ #[ cargo_test( requires_nm, nightly, reason = "-Zremap-path-scope is unstable" ) ]
474
+ fn with_split_debuginfo_packed ( ) {
475
+ object_works_helper ( "packed" , inspect_debuginfo) ;
476
+ }
477
+
478
+ #[ cargo_test( requires_nm, nightly, reason = "-Zremap-path-scope is unstable" ) ]
479
+ fn with_split_debuginfo_unpacked ( ) {
480
+ object_works_helper ( "packed" , inspect_debuginfo) ;
481
+ }
466
482
}
467
483
468
484
#[ cfg( target_os = "linux" ) ]
469
- #[ cargo_test( requires_readelf, nightly, reason = "-Zremap-path-scope is unstable" ) ]
470
- fn object_works ( ) {
471
- object_works_helper ( "off" , |path| {
485
+ mod object_works {
486
+ use super :: * ;
487
+
488
+ fn inspect_debuginfo ( path : & std:: path:: Path ) -> Vec < u8 > {
472
489
std:: process:: Command :: new ( "readelf" )
473
490
. arg ( "-wi" )
474
491
. arg ( path)
475
492
. output ( )
476
493
. expect ( "readelf works" )
477
494
. stdout
478
- } )
495
+ }
496
+
497
+ #[ cargo_test( requires_readelf, nightly, reason = "-Zremap-path-scope is unstable" ) ]
498
+ fn with_split_debuginfo_off ( ) {
499
+ object_works_helper ( "off" , inspect_debuginfo) ;
500
+ }
501
+
502
+ #[ cargo_test( requires_readelf, nightly, reason = "-Zremap-path-scope is unstable" ) ]
503
+ fn with_split_debuginfo_packed ( ) {
504
+ object_works_helper ( "packed" , inspect_debuginfo) ;
505
+ }
506
+
507
+ #[ cargo_test( requires_readelf, nightly, reason = "-Zremap-path-scope is unstable" ) ]
508
+ fn with_split_debuginfo_unpacked ( ) {
509
+ object_works_helper ( "packed" , inspect_debuginfo) ;
510
+ }
479
511
}
480
512
481
513
#[ cfg( unix) ]
@@ -495,7 +527,8 @@ fn object_works_helper(split_debuginfo: &str, run: impl Fn(&std::path::Path) ->
495
527
let p = project ( )
496
528
. file (
497
529
"Cargo.toml" ,
498
- & format ! ( r#"
530
+ & format ! (
531
+ r#"
499
532
[package]
500
533
name = "foo"
501
534
version = "0.0.1"
@@ -505,7 +538,8 @@ fn object_works_helper(split_debuginfo: &str, run: impl Fn(&std::path::Path) ->
505
538
506
539
[profile.dev]
507
540
split-debuginfo = "{split_debuginfo}"
508
- "# ) ,
541
+ "#
542
+ ) ,
509
543
)
510
544
. file ( "src/main.rs" , "fn main() { bar::f(); }" )
511
545
. build ( ) ;
0 commit comments