Skip to content

Commit c38d9b9

Browse files
committed
Remove configure_command_msys* tests at least for now
Because they are not really testing the right thing, due to the distinction between inherited and `.env()`-specified environment. See #1578. While for `configure_command_clears_external_config` this slightly diminishes but largely leaves intact the value of the test, the `configure_command_msys` and `configure_command_msys_extends` tests are really verifying almost nothing, and the latter (for this reason) cannot pass. A variant of it for testing the preceding fix to append to arbitrary environment variable values would likewise not be able to pass. So that is not added at this time. Because the `configure_command_clears_external_config` test remains useful, it is not removed.
1 parent 8dc5d7a commit c38d9b9

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

tests/tools/src/lib.rs

-41
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,6 @@ impl<'a> Drop for Env<'a> {
872872
#[cfg(test)]
873873
mod tests {
874874
use super::*;
875-
use std::ffi::OsStr;
876875

877876
#[test]
878877
fn parse_version() {
@@ -933,44 +932,4 @@ mod tests {
933932
assert_eq!(lines, Vec::<&str>::new(), "should be no config variables from files");
934933
assert_eq!(status, 0, "reading the config should succeed");
935934
}
936-
937-
#[test]
938-
fn configure_command_msys() {
939-
let temp = tempfile::TempDir::new().expect("can create temp dir");
940-
let mut cmd = std::process::Command::new("not-actually-run");
941-
942-
let msys_option = configure_command(&mut cmd, &[], temp.path())
943-
.get_envs()
944-
.find(|(k, _)| *k == OsStr::new("MSYS"))
945-
.expect("should customize MSYS variable")
946-
.1
947-
.expect("should set, not unset, MSYS variable")
948-
.to_str()
949-
.expect("valid UTF-8")
950-
.trim_matches(' ');
951-
952-
assert_eq!(msys_option, "winsymlinks:nativestrict");
953-
}
954-
955-
#[test]
956-
fn configure_command_msys_extends() {
957-
let old_msys = r"error_start:C:\gdb.exe";
958-
let temp = tempfile::TempDir::new().expect("can create temp dir");
959-
let mut cmd = std::process::Command::new("not-actually-run");
960-
cmd.env("MSYS", old_msys);
961-
962-
let msys_options = configure_command(&mut cmd, &[], temp.path())
963-
.get_envs()
964-
.find(|(k, _)| *k == OsStr::new("MSYS"))
965-
.expect("should customize MSYS variable")
966-
.1
967-
.expect("should set, not unset, MSYS variable")
968-
.to_str()
969-
.expect("valid UTF-8")
970-
.split(' ') // Just spaces, not arbitrary whitespace.
971-
.filter(|s| !s.is_empty())
972-
.collect::<Vec<_>>();
973-
974-
assert_eq!(msys_options, vec![old_msys, "winsymlinks:nativestrict"]);
975-
}
976935
}

0 commit comments

Comments
 (0)