blob: 2e5cb4e435dbe76c0b064aa1419b0e0d9f959fcc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# Development Guide
## Testing
To run all tests, run the following command:
```sh
cargo +nightly test --all
```
### UI tests (`tests/ui`, `tests/compiletest.rs`)
This checks errors detected by the macro or the Rust compiler in the resulting
expanded code.
To run this test, run the following command:
```sh
cargo +nightly test --test compiletest
```
Locally, this test updates the files in the `ui` directory if there are
changes to the generated code. If there are any changes to the files in the
`ui` directory after running the test, please commit them.
See also [`trybuild` documentation](https://docs.rs/trybuild).
### Expansion tests (`tests/expand`, `tests/expandtest.rs`)
Similar to ui tests, but instead of checking the compiler output, this checks
the code generated by macros.
See [examples](examples/README.md) for descriptions of what the generated
code does, and why it needs to be generated.
To run this test, run the following command:
```sh
cargo +nightly test --test expandtest
```
Locally, this test updates the files in the `expand` directory if there are
changes to the generated code. If there are any changes to the files in the
`expand` directory after running the test, please commit them.
See also [`macrotest` documentation](https://docs.rs/macrotest).
|