]> git.lizzy.rs Git - rust.git/commitdiff
use ui test mode rather than mir-opt
authorRalf Jung <post@ralfj.de>
Sat, 16 Sep 2017 10:36:28 +0000 (12:36 +0200)
committerRalf Jung <post@ralfj.de>
Sat, 16 Sep 2017 10:36:31 +0000 (12:36 +0200)
These tests are not run per default

13 files changed:
miri/fn_call.rs
tests/compiletest.rs
tests/run-pass-fullmir/catch.rs
tests/run-pass-fullmir/catch.stdout [new file with mode: 0644]
tests/run-pass-fullmir/format.rs [new file with mode: 0644]
tests/run-pass-fullmir/format.stdout [new file with mode: 0644]
tests/run-pass-fullmir/hello.rs [new file with mode: 0644]
tests/run-pass-fullmir/hello.stdout [new file with mode: 0644]
tests/run-pass-fullmir/issue-3794.rs [new file with mode: 0644]
tests/run-pass-fullmir/issue-3794.stdout [new file with mode: 0644]
tests/run-pass/format.rs [deleted file]
tests/run-pass/hello.rs [deleted file]
tests/run-pass/issue-3794.rs [deleted file]

index d64b254e7ebb83e15895ea039c070a6380794982..5285d02b4f0e564890e4ae0e3275940febe7fab5 100644 (file)
@@ -340,7 +340,7 @@ fn call_c_abi(
                         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 @@ fn call_c_abi(
 
             // 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 @@ fn call_missing_fn(
             // 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."
                 );
             }
index f9352efbbdebd6bbe4b9967cba01037457b1c304..b87fd7d243469ceda47b9b51f330f28be210f564 100644 (file)
@@ -5,6 +5,7 @@
 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);
 }
 
index 439edc82dde259a1281baa1b4754740fb9f9fd25..efcfee68eef40a4c316b9e609ed9f9ed4829e2fb 100644 (file)
@@ -3,7 +3,5 @@
 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 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1
diff --git a/tests/run-pass-fullmir/format.rs b/tests/run-pass-fullmir/format.rs
new file mode 100644 (file)
index 0000000..78729b9
--- /dev/null
@@ -0,0 +1,3 @@
+fn main() {
+    println!("Hello {}", 13);
+}
diff --git a/tests/run-pass-fullmir/format.stdout b/tests/run-pass-fullmir/format.stdout
new file mode 100644 (file)
index 0000000..e193b8a
--- /dev/null
@@ -0,0 +1 @@
+Hello 13
diff --git a/tests/run-pass-fullmir/hello.rs b/tests/run-pass-fullmir/hello.rs
new file mode 100644 (file)
index 0000000..e7a11a9
--- /dev/null
@@ -0,0 +1,3 @@
+fn main() {
+    println!("Hello, world!");
+}
diff --git a/tests/run-pass-fullmir/hello.stdout b/tests/run-pass-fullmir/hello.stdout
new file mode 100644 (file)
index 0000000..af5626b
--- /dev/null
@@ -0,0 +1 @@
+Hello, world!
diff --git a/tests/run-pass-fullmir/issue-3794.rs b/tests/run-pass-fullmir/issue-3794.rs
new file mode 100644 (file)
index 0000000..badb833
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(box_syntax)]
+
+trait T {
+    fn print(&self);
+}
+
+#[derive(Debug)]
+struct S {
+    s: isize,
+}
+
+impl T for S {
+    fn print(&self) {
+        println!("{:?}", self);
+    }
+}
+
+fn print_t(t: &T) {
+    t.print();
+}
+
+fn print_s(s: &S) {
+    s.print();
+}
+
+pub fn main() {
+    let s: Box<S> = box S { s: 5 };
+    print_s(&*s);
+    let t: Box<T> = s as Box<T>;
+    print_t(&*t);
+}
diff --git a/tests/run-pass-fullmir/issue-3794.stdout b/tests/run-pass-fullmir/issue-3794.stdout
new file mode 100644 (file)
index 0000000..e4afe6f
--- /dev/null
@@ -0,0 +1,2 @@
+S { s: 5 }
+S { s: 5 }
diff --git a/tests/run-pass/format.rs b/tests/run-pass/format.rs
deleted file mode 100644 (file)
index 78729b9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
-    println!("Hello {}", 13);
-}
diff --git a/tests/run-pass/hello.rs b/tests/run-pass/hello.rs
deleted file mode 100644 (file)
index e7a11a9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
-    println!("Hello, world!");
-}
diff --git a/tests/run-pass/issue-3794.rs b/tests/run-pass/issue-3794.rs
deleted file mode 100644 (file)
index badb833..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(box_syntax)]
-
-trait T {
-    fn print(&self);
-}
-
-#[derive(Debug)]
-struct S {
-    s: isize,
-}
-
-impl T for S {
-    fn print(&self) {
-        println!("{:?}", self);
-    }
-}
-
-fn print_t(t: &T) {
-    t.print();
-}
-
-fn print_s(s: &S) {
-    s.print();
-}
-
-pub fn main() {
-    let s: Box<S> = box S { s: 5 };
-    print_s(&*s);
-    let t: Box<T> = s as Box<T>;
-    print_t(&*t);
-}