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