#generics #parametric #tests

macro generic-tests

Procedural macro to define tests and benchmarks generically

4 releases

0.1.2 Feb 6, 2021
0.1.1 Jul 7, 2020
0.1.0 Jun 25, 2020
0.1.0-beta.1 Jun 24, 2020

#146 in Testing

Download history 10/week @ 2021-06-29 13/week @ 2021-07-06 19/week @ 2021-07-13 10/week @ 2021-07-20 33/week @ 2021-07-27 13/week @ 2021-08-03 351/week @ 2021-08-10 349/week @ 2021-08-17 271/week @ 2021-08-24 438/week @ 2021-08-31 521/week @ 2021-09-07 447/week @ 2021-09-14 440/week @ 2021-09-21 547/week @ 2021-09-28 469/week @ 2021-10-05 500/week @ 2021-10-12

56 downloads per month
Used in 3 crates

MIT/Apache

43KB
955 lines

Procedural macro support for generic test definitions

The procedural attribute macro provided by this crate allows the test writer to reuse code between test cases or benchmarks that use the same test protocol with different types under test. As in general programming with Rust, this is achieved by using generic parameters and trait bounds. The specific test cases are expanded in multiple submodules with type arguments provided in another attribute.

Features

  • Instantiates tests and benchmarks for the built-in test framework.
  • Supports arbitrary test function attributes provided by other crates.
  • A customizable set of attributes is copied from the generic test function to its instantiations.
  • Supports async tests.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~310–730KB
~18K SLoC