@@ -354,7 +354,6 @@ fn custom_linker_env() {
354
354
}
355
355
356
356
#[ cargo_test]
357
- #[ cfg( not( windows) ) ]
358
357
fn target_in_environment_contains_lower_case ( ) {
359
358
let p = project ( ) . file ( "src/main.rs" , "fn main() {}" ) . build ( ) ;
360
359
@@ -364,38 +363,18 @@ fn target_in_environment_contains_lower_case() {
364
363
] ;
365
364
366
365
for target_key in & target_keys {
367
- p. cargo ( "build -v --target x86_64-unknown-linux-musl" )
368
- . env ( target_key, "nonexistent-linker" )
369
- . with_status ( 101 )
370
- . with_stderr_contains ( format ! (
366
+ let mut execs = p. cargo ( "build -v --target x86_64-unknown-linux-musl" ) ;
367
+ execs. env ( target_key, "nonexistent-linker" ) . with_status ( 101 ) ;
368
+ if cfg ! ( windows) {
369
+ execs. with_stderr_does_not_contain ( "warning:[..]" ) ;
370
+ } else {
371
+ execs. with_stderr_contains ( format ! (
371
372
"warning: Environment variables are expected to use uppercase letters and underscores, \
372
373
the variable `{}` will be ignored and have no effect",
373
374
target_key
374
- ) )
375
- . run ( ) ;
376
- }
377
- }
378
-
379
- #[ cargo_test]
380
- #[ cfg( windows) ]
381
- fn target_in_environment_contains_lower_case_on_windows ( ) {
382
- let p = project ( ) . file ( "src/main.rs" , "fn main() {}" ) . build ( ) ;
383
-
384
- let target_keys = [
385
- "CARGO_TARGET_X86_64_UNKNOWN_LINUX_musl_LINKER" ,
386
- "CARGO_TARGET_x86_64_unknown_linux_musl_LINKER" ,
387
- ] ;
388
-
389
- for target_key in & target_keys {
390
- p. cargo ( "build -v --target x86_64-unknown-linux-musl" )
391
- . env ( target_key, "nonexistent-linker" )
392
- . with_status ( 101 )
393
- . with_stderr_does_not_contain ( format ! (
394
- "warning: Environment variables are expected to use uppercase letters and underscores, \
395
- the variable `{}` will be ignored and have no effect",
396
- target_key
397
- ) )
398
- . run ( ) ;
375
+ ) ) ;
376
+ }
377
+ execs. run ( ) ;
399
378
}
400
379
}
401
380
0 commit comments