the program has access to host resources such as environment variables and
randomness (and, eventually, file systems and more).
* `-Zmiri-env-exclude=<var>` keeps the `var` environment variable isolated from
- the host. Can be used multiple times to exclude several variables.
+ the host. Can be used multiple times to exclude several variables. The `TERM`
+ environment variable is excluded by default.
* `-Zmir-opt-level` controls how many MIR optimizations are performed. Miri
overrides the default to be `0`; be advised that using any higher level can
make Miri miss bugs in your program because they got optimized away.
ecx: &mut InterpCx<'mir, 'tcx, Evaluator<'tcx>>,
mut excluded_env_vars: Vec<String>,
) {
- // Exclude TERM var to avoid calls to the file system
+ // Exclude `TERM` var to avoid terminfo trying to open the termcap file.
excluded_env_vars.push("TERM".to_owned());
+
if ecx.machine.communicate {
for (name, value) in std::env::vars() {
if !excluded_env_vars.contains(&name) {
cargo_miri("test") + ["--", "--", "le1"],
"test.stdout.ref2", "test.stderr.ref"
)
+ test("cargo miri test (without isolation)",
+ cargo_miri("test") + ["--", "-Zmiri-disable-isolation", "--", "num_cpus"],
+ "test.stdout.ref3", "test.stderr.ref"
+ )
os.chdir(os.path.dirname(os.path.realpath(__file__)))
--- /dev/null
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out
+
+
+running 1 test
+test num_cpus ... ok
+
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out
+