Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 28, 2019
1 parent b4f2099 commit f726271
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test-cargo-miri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
byteorder = "1.0"
rand = { version = "0.7", features = ["small_rng"] }

[dev-dependencies]
rand = { version = "0.7", features = ["small_rng"] }
num_cpus = "1.10.1"
21 changes: 11 additions & 10 deletions test-cargo-miri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
use byteorder::{BigEndian, ByteOrder};
use rand::{SeedableRng, Rng, rngs::SmallRng};

fn main() {
// Exercise external crate, printing to stdout.
let buf = &[1,2,3,4];
let n = <BigEndian as ByteOrder>::read_u32(buf);
assert_eq!(n, 0x01020304);
println!("{:#010x}", n);
// Try seeding with "real" entropy.
let mut rng = SmallRng::from_entropy();
let _val = rng.gen::<i32>();
let _val = rng.gen::<isize>();
let _val = rng.gen::<i128>();

// Access program arguments, printing to stderr.
for arg in std::env::args() {
eprintln!("{}", arg);
}
// Also try per-thread RNG.
let mut rng = rand::thread_rng();
let _val = rng.gen::<i32>();
let _val = rng.gen::<isize>();
let _val = rng.gen::<i128>();
}

#[cfg(test)]
Expand Down
5 changes: 3 additions & 2 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ echo

# Test
function run_tests {
./miri test
# FIXME debugging
# ./miri test
# "miri test" has built the sysroot for us, now this should pass without
# any interactive questions.
test-cargo-miri/run-test.py
MIRI_LOG=info test-cargo-miri/run-test.py
}

echo "Test host architecture"
Expand Down

0 comments on commit f726271

Please sign in to comment.