Skip to content

Commit

Permalink
Auto merge of #9646 - ehuss:windows-case-disable, r=alexcrichton
Browse files Browse the repository at this point in the history
Temporarily disable windows env test.

This temporarily disables the `target_in_environment_contains_lower_case` test on Windows until rust-lang/rust#85270 gets into nightly.  That PR changes it so that env vars are case-preserved on Windows.  My intent is that after that is in nightly, we can remove the windows-specific code in `Config`, and this test should work the same on all platforms.

Closes #9630
  • Loading branch information
bors committed Jul 2, 2021
2 parents b747054 + c10864a commit 6e31c13
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions tests/testsuite/tool_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ fn custom_linker_env() {
}

#[cargo_test]
// Temporarily disabled until https://github.com/rust-lang/rust/pull/85270 is in nightly.
#[cfg_attr(target_os = "windows", ignore)]
fn target_in_environment_contains_lower_case() {
let p = project().file("src/main.rs", "fn main() {}").build();

Expand All @@ -363,22 +365,16 @@ fn target_in_environment_contains_lower_case() {
target.to_lowercase().replace('-', "_")
);

let mut execs = p.cargo("build -v --target");
execs.arg(target).env(&env_key, "nonexistent-linker");
if cfg!(windows) {
// Windows env keys are case insensitive, so no warning, but it will
// fail due to the missing linker.
execs
.with_stderr_does_not_contain("warning:[..]")
.with_status(101);
} else {
execs.with_stderr_contains(format!(
"warning: Environment variables are expected to use uppercase letters and underscores, \
the variable `{}` will be ignored and have no effect",
p.cargo("build -v --target")
.arg(target)
.env(&env_key, "nonexistent-linker")
.with_stderr_contains(format!(
"warning: Environment variables are expected to use uppercase \
letters and underscores, the variable `{}` will be ignored and \
have no effect",
env_key
));
}
execs.run();
))
.run();
}

#[cargo_test]
Expand Down

0 comments on commit 6e31c13

Please sign in to comment.