@@ -4132,10 +4132,8 @@ fn building_a_dependent_crate_witout_bin_should_fail() {
4132
4132
}
4133
4133
4134
4134
#[ test]
4135
+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
4135
4136
fn uplift_dsym_of_bin_on_mac ( ) {
4136
- if !cfg ! ( any( target_os = "macos" , target_os = "ios" ) ) {
4137
- return ;
4138
- }
4139
4137
let p = project ( )
4140
4138
. file ( "src/main.rs" , "fn main() { panic!(); }" )
4141
4139
. file ( "src/bin/b.rs" , "fn main() { panic!(); }" )
@@ -4144,23 +4142,17 @@ fn uplift_dsym_of_bin_on_mac() {
4144
4142
. build ( ) ;
4145
4143
4146
4144
p. cargo ( "build --bins --examples --tests" ) . run ( ) ;
4147
- assert ! ( p. bin( "foo.dSYM" ) . is_dir( ) ) ;
4148
- assert ! ( p. bin( "b.dSYM" ) . is_dir( ) ) ;
4149
- assert ! ( p
4150
- . bin( "b.dSYM" )
4151
- . symlink_metadata( )
4152
- . expect( "read metadata from b.dSYM" )
4153
- . file_type( )
4154
- . is_symlink( ) ) ;
4155
- assert ! ( !p. bin( "c.dSYM" ) . is_dir( ) ) ;
4156
- assert ! ( !p. bin( "d.dSYM" ) . is_dir( ) ) ;
4145
+ assert ! ( p. target_debug_dir( ) . join( "foo.dSYM" ) . is_dir( ) ) ;
4146
+ assert ! ( p. target_debug_dir( ) . join( "b.dSYM" ) . is_dir( ) ) ;
4147
+ assert ! ( p. target_debug_dir( ) . join( "b.dSYM" ) . is_symlink( ) ) ;
4148
+ assert ! ( p. target_debug_dir( ) . join( "examples/c.dSYM" ) . is_symlink( ) ) ;
4149
+ assert ! ( !p. target_debug_dir( ) . join( "c.dSYM" ) . exists( ) ) ;
4150
+ assert ! ( !p. target_debug_dir( ) . join( "d.dSYM" ) . exists( ) ) ;
4157
4151
}
4158
4152
4159
4153
#[ test]
4154
+ #[ cfg( all( target_os = "windows" , target_env = "msvc" ) ) ]
4160
4155
fn uplift_pdb_of_bin_on_windows ( ) {
4161
- if !cfg ! ( all( target_os = "windows" , target_env = "msvc" ) ) {
4162
- return ;
4163
- }
4164
4156
let p = project ( )
4165
4157
. file ( "src/main.rs" , "fn main() { panic!(); }" )
4166
4158
. file ( "src/bin/b.rs" , "fn main() { panic!(); }" )
@@ -4171,8 +4163,10 @@ fn uplift_pdb_of_bin_on_windows() {
4171
4163
p. cargo ( "build --bins --examples --tests" ) . run ( ) ;
4172
4164
assert ! ( p. target_debug_dir( ) . join( "foo.pdb" ) . is_file( ) ) ;
4173
4165
assert ! ( p. target_debug_dir( ) . join( "b.pdb" ) . is_file( ) ) ;
4174
- assert ! ( !p. target_debug_dir( ) . join( "c.pdb" ) . is_file( ) ) ;
4175
- assert ! ( !p. target_debug_dir( ) . join( "d.pdb" ) . is_file( ) ) ;
4166
+ assert ! ( !p. target_debug_dir( ) . join( "examples/c.pdb" ) . exists( ) ) ;
4167
+ assert_eq ! ( p. glob( "target/debug/examples/c-*.pdb" ) . count( ) , 1 ) ;
4168
+ assert ! ( !p. target_debug_dir( ) . join( "c.pdb" ) . exists( ) ) ;
4169
+ assert ! ( !p. target_debug_dir( ) . join( "d.pdb" ) . exists( ) ) ;
4176
4170
}
4177
4171
4178
4172
// Ensure that `cargo build` chooses the correct profile for building
0 commit comments