diff --git a/tests/compiletest.rs b/tests/compiletest.rs index eaf7f8531b8f..c5fba3d46e2f 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -37,6 +37,9 @@ fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec) { flags.push(format!("--sysroot {}", sysroot)); } + // Add a test env var to do evironment communication tests + std::env::set_var("MIRI_ENV_VAR_TEST", "0"); + // The rest of the configuration. let mut config = compiletest::Config::default().tempdir(); config.mode = mode.parse().expect("Invalid mode"); diff --git a/tests/run-pass/communication.rs b/tests/run-pass/communication.rs index 08c6bd88fd68..e3fb0c5bd5e0 100644 --- a/tests/run-pass/communication.rs +++ b/tests/run-pass/communication.rs @@ -2,5 +2,5 @@ // compile-flags: -Zmiri-enable-communication fn main() { - assert!(std::env::var("PWD").is_ok()); + assert_eq!(std::env::var("MIRI_ENV_VAR_TEST"), Ok("0".to_owned())); }