1 unstable release

0.0.0 Apr 24, 2023
Download history 7/week @ 2023-10-29 5/week @ 2023-11-05 7/week @ 2023-11-12 5/week @ 2023-11-19 9/week @ 2023-11-26 5/week @ 2023-12-03 5/week @ 2023-12-10 4/week @ 2023-12-17 6/week @ 2023-12-24 2/week @ 2023-12-31 6/week @ 2024-01-07 4/week @ 2024-01-14 3/week @ 2024-01-21 6/week @ 2024-01-28 5/week @ 2024-02-04 56/week @ 2024-02-11

70 downloads per month
Used in hydroflow

Apache-2.0

7KB
127 lines

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::multiplatform_test;

#[multiplatform_test]
fn my_test() {
  // ...
}

Expands to

#[test]
#[wasm_bindgen_test_macro::wasm_bindgen_test]
fn my_test() {
  // ...
}

Installation

Because the multiplaform_test macro expands to wasm_bindgen_test_macro, you will also need to depend on the wasm_bindgen_test_macro crate.

Usage

Specifying platforms

You can test on a subset of platforms by passing in the platforms in parens:

use multiplatform_test::multiplatform_test;

#[multiplatform_test(default)]  // Only test on the default #[test] platform
fn my_test() {
  // ...
}

expands to

use multiplatform_test::multiplatform_test;

#[test]
fn my_test() {
  // ...
}

Dependencies

~84KB