Crate generic_tests

Source
Expand description

Support for generic test definitions with a procedural attribute macro.

The define 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 or constant values supplied to specific tests. As in general programming with Rust, this is achieved by using generic parameters and trait bounds. A module processed by the define macro contains generic test functions that are annotated with attributes consumed by the test framework, such as test or bench. The actual test cases can be instantiated in multiple submodules annotated with the instantiate_tests attribute providing specific argument types for the tests.

Attribute Macros§

define
Populates a module tree with test cases parameterizing generic definitions.