Skip to content

Commit

Permalink
check RUST_BOOTSTRAP_CONFIG in profile_user_dist test
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed Jan 21, 2024
1 parent c485ee7 commit 8e4bc87
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/bootstrap/src/tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ fn override_toml_duplicate() {
#[test]
fn profile_user_dist() {
fn get_toml(file: &Path) -> TomlConfig {
let contents = if file.ends_with("config.toml") {
"profile = \"user\"".to_owned()
} else {
assert!(file.ends_with("config.dist.toml"));
std::fs::read_to_string(file).unwrap()
};
let contents =
if file.ends_with("config.toml") || env::var_os("RUST_BOOTSTRAP_CONFIG").is_some() {
"profile = \"user\"".to_owned()
} else {
assert!(file.ends_with("config.dist.toml"));
std::fs::read_to_string(file).unwrap()
};

toml::from_str(&contents)
.and_then(|table: toml::Value| TomlConfig::deserialize(table))
.unwrap()
Expand Down

0 comments on commit 8e4bc87

Please sign in to comment.