Debian Codegraph @

third_party/rust/pin-project/DEVELOPMENT.md

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