macrotest

Travis-CI Crates.io docs.rs Crates.io Crates.io

Similar to [trybuild], but allows you to write tests on how macros are expanded.


Documentation

Please refer to the documentation.

Example

Install nightly rust, [cargo expand] and [rustfmt].

A minimal macrotest setup looks like this:

In project's Cargo.toml:

toml [dev-dependencies] macrotest = "0.1"

Under project's tests/ directory create tests.rs:

```rust

[test]

pub fn pass() { macrotest::expand("tests/expand/*.rs"); } ```

Populate the /tests/expand directory with rust source files. Each file is a macro expansion test case.