@@ -59,43 +59,6 @@ Likewise, you can test a single file by passing its path:
5959./x.py test src/test/ui/const-generics/const-test.rs
6060```
6161
62- ### Run the UI test suite
63-
64- The UI test suite is special in that it tests the command-line output
65- of the compiler, e.g. the wording and formatting of warnings and errors.
66- Every UI test file such as ` foo.rs ` will have a corresponding file
67- ` foo.stderr ` describing its expected output.
68-
69- Similar to any other test suite, the UI test suite can be run with:
70-
71- ``` bash
72- ./x.py test src/test/ui
73- ```
74-
75- If you have made a change to the way that the compiler formats its output,
76- it would be extraordinarily tedious to have to reformat every ` *.stderr `
77- file manually. Fortunately there exists a flag that will allow you to
78- "bless" the current output of the compiler as the expected output.
79- When using this flag with the test runner, any UI tests that would
80- ordinarily fail will instead have their ` *.stderr ` files overwritten
81- with whatever output the compiler produces:
82-
83- ``` bash
84- ./x.py test src/test/ui --bless
85- ```
86-
87- Some UI tests will have different output depending on which "mode" that
88- the compiler is in. Specifically, the compiler may have different output
89- depending on whether the feature "non-lexical lifetimes" (NLL) is enabled.
90- Any UI test such as ` foo.rs ` whose output differs with NLL enabled will
91- have both a ` foo.stderr ` file and a ` foo.nll.stderr ` file.
92- By default, the UI test suite will not be run in NLL mode.
93- To run the UI test suite in NLL mode, use the following:
94-
95- ``` bash
96- ./x.py test src/test/ui --compare-mode=nll
97- ```
98-
9962### Run only the tidy script
10063
10164``` bash
@@ -195,6 +158,21 @@ Note that incremental compilation will use more disk space than usual.
195158If disk space is a concern for you, you might want to check the size
196159of the ` build ` directory from time to time.
197160
161+ ## Running tests with different "compare modes"
162+
163+ UI tests may have different output depending on certain "modes" that
164+ the compiler is in. For example, when in "non-lexical lifetimes" (NLL)
165+ mode a test ` foo.rs ` will first look for expected output in
166+ ` foo.nll.stderr ` , falling back to the usual ` foo.stderr ` if not found.
167+ To run the UI test suite in NLL mode, one would use the following:
168+
169+ ``` bash
170+ ./x.py test src/test/ui --compare-mode=nll
171+ ```
172+
173+ Other examples of compare-modes are "noopt", "migrate", and
174+ [ revisions] ( ./adding.html#revisions ) .
175+
198176## Running tests manually
199177
200178Sometimes it's easier and faster to just run the test by hand. Most tests are
0 commit comments