Skip to content

Commit 055e90d

Browse files
committed
'cargo update' test-cargo-miri
1 parent e9e67c9 commit 055e90d

File tree

9 files changed

+27
-25
lines changed

9 files changed

+27
-25
lines changed

test-cargo-miri/Cargo.lock

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-cargo-miri/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ byteorder = "1.0"
1212

1313
[dev-dependencies]
1414
rand = { version = "0.7", features = ["small_rng"] }
15-
num_cpus = "1.10.1"
1615

1716
[lib]
1817
test = false # test that this is respected (will show in the output)

test-cargo-miri/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ fn main() {
1919
}
2020

2121
// If there were no arguments, access stdin and test working dir.
22+
// (We rely on the test runner to always disable isolation when passing no arguments.)
2223
if std::env::args().len() <= 1 {
2324
// CWD should be crate root.
2425
// We have to normalize slashes, as the env var might be set for a different target's conventions.
@@ -33,7 +34,7 @@ fn main() {
3334
let num: i32 = line.unwrap().parse().unwrap();
3435
println!("{}", 2*num);
3536
}
36-
// On non-Unix, reading from stdin is not support. So we hard-code the right answer.
37+
// On non-Unix, reading from stdin is not supported. So we hard-code the right answer.
3738
#[cfg(not(unix))]
3839
{
3940
println!("24");

test-cargo-miri/subcrate/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ path = "main.rs"
1212
name = "subtest"
1313
path = "test.rs"
1414
harness = false
15+
16+
[dev-dependencies]
17+
num_cpus = "1.10.1"

test-cargo-miri/subcrate/test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ fn main() {
1010
let crate_dir = env::var_os("CARGO_MANIFEST_DIR").unwrap();
1111
let crate_dir = crate_dir.to_string_lossy().replace("\\", "/");
1212
assert_eq!(env_dir, crate_dir);
13+
14+
// Make sure we can call `num_cpus`.
15+
num_cpus::get();
1316
}

test-cargo-miri/test.stdout.ref1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ running 1 test
44
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
55

66

7-
running 8 tests
8-
..i.....
9-
test result: ok. 7 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out
7+
running 7 tests
8+
..i....
9+
test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out
1010

test-cargo-miri/test.stdout.ref2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out
77
running 1 test
88
test simple1 ... ok
99

10-
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out
10+
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out
1111

test-cargo-miri/test.stdout.ref3

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11

2-
running 8 tests
2+
running 7 tests
33
test cargo_env ... ok
44
test do_panic ... ok
55
test does_not_work_on_miri ... ignored
66
test entropy_rng ... ok
77
test fail_index_check ... ok
8-
test num_cpus ... ok
98
test simple1 ... ok
109
test simple2 ... ok
1110

12-
test result: ok. 7 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out
11+
test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out
1312

test-cargo-miri/tests/test.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ fn entropy_rng() {
3737
let _val = rng.gen::<i128>();
3838
}
3939

40-
#[test]
41-
fn num_cpus() {
42-
assert_eq!(num_cpus::get(), 1);
43-
}
44-
4540
#[test]
4641
fn cargo_env() {
4742
assert_eq!(env!("CARGO_PKG_NAME"), "cargo-miri-test");

0 commit comments

Comments
 (0)