-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Improve testing infrastructure
Move common test code to a reusable module, and have many different test files use this common module. This then eliminates the need for many different cargo features, and makes the code much more readable. We also add testing for custom/cpurand, making sure it builds/links on our various x86 targets. Signed-off-by: Joe Richey <[email protected]>
- Loading branch information
Showing
11 changed files
with
50 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Call cpurand so that it will be invoked on std targets (like Linux). | ||
use cpurand_getrandom::cpurand as getrandom; | ||
#[path = "../../../tests/common/mod.rs"] | ||
mod common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Explicitly use the Custom RNG crate to link it in. | ||
use cpurand_getrandom as _; | ||
|
||
use getrandom::getrandom; | ||
#[path = "../../../tests/common/mod.rs"] | ||
mod common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Explicitly use the Custom RNG crate to link it in. | ||
use stdweb_getrandom as _; | ||
|
||
use getrandom::getrandom; | ||
use test; | ||
#[path = "../../../tests/common/mod.rs"] | ||
mod common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Explicitly use the Custom RNG crate to link it in. | ||
use wasm_bindgen_getrandom as _; | ||
|
||
use getrandom::getrandom; | ||
use wasm_bindgen_test::wasm_bindgen_test as test; | ||
#[path = "../../../tests/common/mod.rs"] | ||
mod common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Explicitly use the Custom RNG crate to link it in. | ||
use wasm_bindgen_getrandom as _; | ||
|
||
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); | ||
|
||
use getrandom::getrandom; | ||
use wasm_bindgen_test::wasm_bindgen_test as test; | ||
#[path = "../../../tests/common/mod.rs"] | ||
mod common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use getrandom::getrandom; | ||
mod common; |