diff --git a/.travis.yml b/.travis.yml index 5a2a893196dc..5bc7f291d762 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,11 @@ before_script: - cargo install xargo - export RUST_SYSROOT=$HOME/rust script: +- | + # get ourselves a MIR-ful libstd + cd xargo && + RUSTFLAGS='-Zalways-encode-mir' xargo build && + cd .. - | # Test plain miri cargo build && @@ -22,11 +27,7 @@ script: cargo miri test && cd .. - | - # get ourselves a MIR-ful libstd - cd xargo && - RUSTFLAGS='-Zalways-encode-mir' xargo build && - cd .. && - # and run the tests with it + # and run all tests with full mir MIRI_SYSROOT=~/.xargo/HOST cargo test notifications: email: diff --git a/tests/compiletest.rs b/tests/compiletest.rs index e6535ef0212b..fe9cbd647906 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -27,13 +27,17 @@ fn run_pass() { compiletest::run_tests(&config); } -fn miri_pass(path: &str, target: &str, host: &str) { +fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool) { let mut config = compiletest::default_config(); config.mode = "mir-opt".parse().expect("Invalid mode"); config.src_base = PathBuf::from(path); config.target = target.to_owned(); config.host = host.to_owned(); config.rustc_path = PathBuf::from("target/debug/miri"); + if fullmir { + let sysroot = Path::new(&std::env::var("HOME").unwrap()).join(".xargo").join("HOST"); + config.target_rustcflags = Some(format!("--sysroot {}", sysroot.to_str().unwrap())); + } // don't actually execute the final binary, it might be for other targets and we only care // about running miri, not the binary. config.runtool = Some("echo \"\" || ".to_owned()); @@ -116,6 +120,7 @@ fn compile_test() { let sysroot = libs.join("rustlib").join(&host).join("lib"); let paths = std::env::join_paths(&[libs, sysroot]).unwrap(); cmd.env(compiletest::procsrv::dylib_env_var(), paths); + cmd.env("MIRI_SYSROOT", Path::new(&std::env::var("HOME").unwrap()).join(".xargo").join("HOST")); match cmd.output() { Ok(ref output) if output.status.success() => { @@ -197,8 +202,9 @@ fn compile_test() { } else { run_pass(); for_all_targets(sysroot, |target| { - miri_pass("tests/run-pass", &target, host); + miri_pass("tests/run-pass", &target, host, false); }); + miri_pass("tests/run-pass-fullmir", host, host, true); compile_fail(sysroot); } } diff --git a/tests/run-pass/loop-break-value.rs b/tests/run-pass-fullmir/loop-break-value.rs similarity index 100% rename from tests/run-pass/loop-break-value.rs rename to tests/run-pass-fullmir/loop-break-value.rs