multiplatform_test
Provides a proc-macro that expands to testing on platforms relevant to
Hydroflow. By default, expands to testing on the host (using the normal
#[test] attribute) and wasm (using #[wasm_bindgen_test]).
For example, the test
use multiplatform_test;
Expands to
Installation
[]
= * # replace with version.
If you're using wasm naturally you will need to add the wasm_bindgen_test
crate as a dependency.
Usage
Specifying platforms
There are many platforms which can be specified:
test- Adds a standard#[test]attribute.tokio- Adds a#[tokio::test]attribute.async_std- Adds an#[async_std::test]attribute.hydroflow- Adds a#[dfir_rs::test]attribute.wasm- Adds a#[wasm_bindgen_test::wasm_bindgen_test]attribute.env_logging- Registersenv_loggerforlogging.env_tracing- Registers aFmtSubscriberwith anEnvFilterfortracing.
You can test on a subset of platforms by passing in the platforms in parens:
use multiplatform_test;
// Only test on the standard `#[test]` platform, but enables logging
expands to
use multiplatform_test;