1
Fork 0

add num_cpus crate test

This commit is contained in:
Ralf Jung 2022-07-22 20:53:20 -04:00
parent 963f08b702
commit 00b382d1a5
4 changed files with 8 additions and 1 deletions

View file

@ -107,6 +107,7 @@ dependencies = [
"getrandom 0.1.16",
"getrandom 0.2.7",
"libc",
"num_cpus",
"page_size",
"rand",
"tokio",

View file

@ -12,6 +12,7 @@ edition = "2021"
tokio = { version = "1.0", features = ["full"] }
libc = "0.2"
page_size = "0.4.1"
num_cpus = "1.10.1"
getrandom_1 = { package = "getrandom", version = "0.1" }
getrandom_2 = { package = "getrandom", version = "0.2" }

View file

@ -0,0 +1,5 @@
//@compile-flags: -Zmiri-disable-isolation
fn main() {
assert_eq!(num_cpus::get(), 1);
}

View file

@ -1,6 +1,6 @@
use rand::{rngs::SmallRng, Rng, SeedableRng};
// mac-os `getrandom_1` does some pointer shenanigans
//@compile-flags: -Zmiri-permissive-provenance
use rand::{rngs::SmallRng, Rng, SeedableRng};
fn main() {
// Test `getrandom` directly (in multiple different versions).