| Crates.io | macrotest |
| lib.rs | macrotest |
| version | 1.2.0 |
| created_at | 2019-10-29 09:30:29.954667+00 |
| updated_at | 2025-07-31 05:38:23.511214+00 |
| description | Test harness for macro expansion |
| homepage | |
| repository | https://github.com/eupn/macrotest |
| max_upload_size | |
| id | 176602 |
| size | 51,341 |
macrotestSimilar to trybuild, but allows you to test how declarative or procedural macros are expanded.
Minimal Supported Rust Version: 1.66
Please refer to the documentation.
Install cargo expand.
Add to your crate's Cargo.toml:
[dev-dependencies]
macrotest = "1"
Under your crate's tests/ directory, create tests.rs file containing the following code:
#[test]
pub fn pass() {
macrotest::expand("tests/expand/*.rs");
}
Populate the tests/expand/ directory with rust source files. Each source file is a macro expansion test case.
See test-project and test-procmacro-project for the reference.