Add env var test variable in compiletest

This commit is contained in:
Christian Poveda 2019-08-07 09:09:13 -05:00
parent b731a6a15f
commit af623dede2
2 changed files with 4 additions and 1 deletions

View file

@ -37,6 +37,9 @@ fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec<String>) {
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");

View file

@ -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()));
}