Skip to content

Commit af623de

Browse files
committed
Add env var test variable in compiletest
1 parent b731a6a commit af623de

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/compiletest.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec<String>) {
3737
flags.push(format!("--sysroot {}", sysroot));
3838
}
3939

40+
// Add a test env var to do evironment communication tests
41+
std::env::set_var("MIRI_ENV_VAR_TEST", "0");
42+
4043
// The rest of the configuration.
4144
let mut config = compiletest::Config::default().tempdir();
4245
config.mode = mode.parse().expect("Invalid mode");

tests/run-pass/communication.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
// compile-flags: -Zmiri-enable-communication
33

44
fn main() {
5-
assert!(std::env::var("PWD").is_ok());
5+
assert_eq!(std::env::var("MIRI_ENV_VAR_TEST"), Ok("0".to_owned()));
66
}

0 commit comments

Comments
 (0)