Skip to content

Commit f726271

Browse files
committed
debug
1 parent b4f2099 commit f726271

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

test-cargo-miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2018"
66

77
[dependencies]
88
byteorder = "1.0"
9+
rand = { version = "0.7", features = ["small_rng"] }
910

1011
[dev-dependencies]
11-
rand = { version = "0.7", features = ["small_rng"] }
1212
num_cpus = "1.10.1"

test-cargo-miri/src/main.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
use byteorder::{BigEndian, ByteOrder};
1+
use rand::{SeedableRng, Rng, rngs::SmallRng};
22

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

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

1617
#[cfg(test)]

travis.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ echo
1717

1818
# Test
1919
function run_tests {
20-
./miri test
20+
# FIXME debugging
21+
# ./miri test
2122
# "miri test" has built the sysroot for us, now this should pass without
2223
# any interactive questions.
23-
test-cargo-miri/run-test.py
24+
MIRI_LOG=info test-cargo-miri/run-test.py
2425
}
2526

2627
echo "Test host architecture"

0 commit comments

Comments
 (0)