Skip to content

Commit bb6e7c8

Browse files
authored
Merge branch 'master' into sanity_checks
2 parents e6f1e15 + 79d0a01 commit bb6e7c8

File tree

7 files changed

+19
-8
lines changed

7 files changed

+19
-8
lines changed

.travis.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,19 @@ script:
3030
RUST_BACKTRACE=1 cargo test --release --all-features --all &&
3131
cargo install --all-features --force
3232
- |
33-
# Test cargo miri
33+
# Test `cargo miri`
3434
cd cargo-miri-test &&
35-
cargo miri &&
35+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
36+
MIRI_SYSROOT=~/.xargo/HOST cargo miri -q -- -Zmiri-start-fn
37+
else
38+
MIRI_SYSROOT=~/.xargo/HOST cargo miri -q -- -Zmiri-start-fn >stdout.real 2>stderr.real &&
39+
cat stdout.real stderr.real &&
40+
# Test `cargo miri` output. Not on mac because output redirecting doesn't
41+
# work. There is no error. It just stops CI.
42+
diff -u stdout.ref stdout.real &&
43+
diff -u stderr.ref stderr.real
44+
fi &&
45+
# Test `cargo miri test`
3646
#cargo miri test &&
3747
cd ..
3848
- |

cargo-miri-test/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.real

cargo-miri-test/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ fn main() {
66
let buf = &[1,2,3,4];
77
let n = <BigEndian as ByteOrder>::read_u32(buf);
88
assert_eq!(n, 0x01020304);
9+
//println!("{:#x}", n); FIXME enable once memrchr works in miri
10+
eprintln!("standard error");
911
}

cargo-miri-test/stderr.ref

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
standard error

cargo-miri-test/stdout.ref

Whitespace-only changes.

src/fn_call.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
612612

613613
// Stub out all the other pthread calls to just return 0
614614
link_name if link_name.starts_with("pthread_") => {
615-
info!("ignoring C ABI call: {}", link_name);
615+
debug!("ignoring C ABI call: {}", link_name);
616616
self.write_null(dest, dest_ty)?;
617617
}
618618

@@ -759,7 +759,8 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
759759
match &path[..] {
760760
// A Rust function is missing, which means we are running with MIR missing for libstd (or other dependencies).
761761
// Still, we can make many things mostly work by "emulating" or ignoring some functions.
762-
"std::io::_print" => {
762+
"std::io::_print" |
763+
"std::io::_eprint" => {
763764
warn!(
764765
"Ignoring output. To run programs that print, make sure you have a libstd with full MIR."
765766
);

tests/compiletest.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use colored::*;
88
use std::slice::SliceConcatExt;
99
use std::path::{PathBuf, Path};
1010
use std::io::Write;
11-
use std::env;
1211

1312
macro_rules! eprintln {
1413
($($arg:tt)*) => {
@@ -111,9 +110,6 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir:
111110
// For now, only validate without optimizations. Inlining breaks validation.
112111
flags.push("-Zmir-emit-validate=1".to_owned());
113112
}
114-
// Control miri logging. This is okay despite concurrent test execution as all tests
115-
// will set this env var to the same value.
116-
env::set_var("MIRI_LOG", "warn");
117113
config.target_rustcflags = Some(flags.join(" "));
118114
compiletest::run_tests(&config);
119115
}

0 commit comments

Comments
 (0)