diff options
| author | Ralf Jung <post@ralfj.de> | 2017-09-16 13:09:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-16 13:09:28 +0200 |
| commit | 605c82be7a9624e9a5d4f71b6f3ae4fbad8ca001 (patch) | |
| tree | 52c7edba91ac7c66ef139acc132f23ba4ed3d881 | |
| parent | 6d4840e9292e1b5ac217c232a2baded010c7703c (diff) | |
| parent | e7b0637e681b0a4c167e094ab24d3ecd8da4ef2f (diff) | |
| download | rust-605c82be7a9624e9a5d4f71b6f3ae4fbad8ca001.tar.gz rust-605c82be7a9624e9a5d4f71b6f3ae4fbad8ca001.zip | |
Merge pull request #343 from RalfJung/tests
use ui test mode rather than mir-opt
| -rw-r--r-- | miri/fn_call.rs | 6 | ||||
| -rw-r--r-- | tests/compiletest.rs | 9 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/catch.rs | 4 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/catch.stdout | 1 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/format.rs (renamed from tests/run-pass/format.rs) | 0 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/format.stdout | 1 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/hello.rs (renamed from tests/run-pass/hello.rs) | 0 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/hello.stdout | 1 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/issue-3794.rs (renamed from tests/run-pass/issue-3794.rs) | 0 | ||||
| -rw-r--r-- | tests/run-pass-fullmir/issue-3794.stdout | 2 |
10 files changed, 14 insertions, 10 deletions
diff --git a/miri/fn_call.rs b/miri/fn_call.rs index d64b254e7eb..5285d02b4f0 100644 --- a/miri/fn_call.rs +++ b/miri/fn_call.rs @@ -340,7 +340,7 @@ impl<'a, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'tcx, super::Evaluator> Err(_) => -1, } } else { - info!("Ignored output to FD {}", fd); + warn!("Ignored output to FD {}", fd); n as isize // pretend it all went well }; // now result is the value we return back to the program self.write_primval( @@ -456,7 +456,7 @@ impl<'a, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'tcx, super::Evaluator> // Stub out all the other pthread calls to just return 0 link_name if link_name.starts_with("pthread_") => { - warn!("ignoring C ABI call: {}", link_name); + info!("ignoring C ABI call: {}", link_name); self.write_null(dest, dest_ty)?; } @@ -616,7 +616,7 @@ impl<'a, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'tcx, super::Evaluator> // A Rust function is missing, which means we are running with MIR missing for libstd (or other dependencies). // Still, we can make many things mostly work by "emulating" or ignoring some functions. "std::io::_print" => { - trace!( + warn!( "Ignoring output. To run programs that print, make sure you have a libstd with full MIR." ); } diff --git a/tests/compiletest.rs b/tests/compiletest.rs index f9352efbbde..b87fd7d2434 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -5,6 +5,7 @@ extern crate compiletest_rs as compiletest; use std::slice::SliceConcatExt; use std::path::{PathBuf, Path}; use std::io::Write; +use std::env; macro_rules! eprintln { ($($arg:tt)*) => { @@ -90,7 +91,7 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) { opt_str ); let mut config = compiletest::Config::default().tempdir(); - config.mode = "mir-opt".parse().expect("Invalid mode"); + config.mode = "ui".parse().expect("Invalid mode"); config.src_base = PathBuf::from(path); config.target = target.to_owned(); config.host = host.to_owned(); @@ -100,6 +101,9 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) { config.compile_lib_path = rustc_lib_path(); } let mut flags = Vec::new(); + // Control miri logging. This is okay despite concurrent test execution as all tests + // will set this env var to the same value. + env::set_var("MIRI_LOG", "warn"); // if we are building as part of the rustc test suite, we already have fullmir for everything if fullmir && rustc_test_suite().is_none() { if host != target { @@ -122,9 +126,6 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) { flags.push("--miri_host_target".to_owned()); } config.target_rustcflags = Some(flags.join(" ")); - // 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()); compiletest::run_tests(&config); } diff --git a/tests/run-pass-fullmir/catch.rs b/tests/run-pass-fullmir/catch.rs index 439edc82dde..efcfee68eef 100644 --- a/tests/run-pass-fullmir/catch.rs +++ b/tests/run-pass-fullmir/catch.rs @@ -3,7 +3,5 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; fn main() { let mut i = 3; let _ = catch_unwind(AssertUnwindSafe(|| {i -= 2;} )); - for _ in 0..i { - println!("I"); - } + println!("{}", i); } diff --git a/tests/run-pass-fullmir/catch.stdout b/tests/run-pass-fullmir/catch.stdout new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/tests/run-pass-fullmir/catch.stdout @@ -0,0 +1 @@ +1 diff --git a/tests/run-pass/format.rs b/tests/run-pass-fullmir/format.rs index 78729b91561..78729b91561 100644 --- a/tests/run-pass/format.rs +++ b/tests/run-pass-fullmir/format.rs diff --git a/tests/run-pass-fullmir/format.stdout b/tests/run-pass-fullmir/format.stdout new file mode 100644 index 00000000000..e193b8ae89f --- /dev/null +++ b/tests/run-pass-fullmir/format.stdout @@ -0,0 +1 @@ +Hello 13 diff --git a/tests/run-pass/hello.rs b/tests/run-pass-fullmir/hello.rs index e7a11a969c0..e7a11a969c0 100644 --- a/tests/run-pass/hello.rs +++ b/tests/run-pass-fullmir/hello.rs diff --git a/tests/run-pass-fullmir/hello.stdout b/tests/run-pass-fullmir/hello.stdout new file mode 100644 index 00000000000..af5626b4a11 --- /dev/null +++ b/tests/run-pass-fullmir/hello.stdout @@ -0,0 +1 @@ +Hello, world! diff --git a/tests/run-pass/issue-3794.rs b/tests/run-pass-fullmir/issue-3794.rs index badb833ee80..badb833ee80 100644 --- a/tests/run-pass/issue-3794.rs +++ b/tests/run-pass-fullmir/issue-3794.rs diff --git a/tests/run-pass-fullmir/issue-3794.stdout b/tests/run-pass-fullmir/issue-3794.stdout new file mode 100644 index 00000000000..e4afe6fa55f --- /dev/null +++ b/tests/run-pass-fullmir/issue-3794.stdout @@ -0,0 +1,2 @@ +S { s: 5 } +S { s: 5 } |
