diff --git a/test_dependencies/Cargo.lock b/test_dependencies/Cargo.lock index 6b5e8c94224..a492deba4c5 100644 --- a/test_dependencies/Cargo.lock +++ b/test_dependencies/Cargo.lock @@ -107,6 +107,7 @@ dependencies = [ "getrandom 0.1.16", "getrandom 0.2.7", "libc", + "page_size", "rand", "tokio", ] @@ -127,6 +128,16 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +[[package]] +name = "page_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "parking_lot" version = "0.12.1" diff --git a/test_dependencies/Cargo.toml b/test_dependencies/Cargo.toml index edaa6a69260..0bf43aefebf 100644 --- a/test_dependencies/Cargo.toml +++ b/test_dependencies/Cargo.toml @@ -11,6 +11,7 @@ edition = "2021" # all dependencies (and their transitive ones) listed here can be used in `tests/`. tokio = { version = "1.0", features = ["full"] } libc = "0.2" +page_size = "0.4.1" getrandom_1 = { package = "getrandom", version = "0.1" } getrandom_2 = { package = "getrandom", version = "0.2" } diff --git a/tests/fail/tokio_mvp.rs b/tests/fail/crates/tokio_mvp.rs similarity index 100% rename from tests/fail/tokio_mvp.rs rename to tests/fail/crates/tokio_mvp.rs diff --git a/tests/fail/tokio_mvp.stderr b/tests/fail/crates/tokio_mvp.stderr similarity index 100% rename from tests/fail/tokio_mvp.stderr rename to tests/fail/crates/tokio_mvp.stderr diff --git a/tests/pass/crates/page_size.rs b/tests/pass/crates/page_size.rs new file mode 100644 index 00000000000..cdcabf33338 --- /dev/null +++ b/tests/pass/crates/page_size.rs @@ -0,0 +1,6 @@ +fn main() { + let page_size = page_size::get(); + + // In particular, this checks that it is not 0. + assert!(page_size.is_power_of_two(), "page size not a power of two: {}", page_size); +} diff --git a/tests/pass/random.rs b/tests/pass/crates/random.rs similarity index 100% rename from tests/pass/random.rs rename to tests/pass/crates/random.rs