@@ -18,7 +18,7 @@ a subset of test collections, and merge queue CI will exercise all of the test
1818collection.
1919</div >
2020
21- ``` bash 
21+ ``` text 
2222./x test 
2323``` 
2424
@@ -45,22 +45,22 @@ tests. For example, a good "smoke test" that can be used after modifying rustc
4545to see if things are generally working correctly would be to exercise the ` ui ` 
4646test suite ([ ` tests/ui ` ] ):
4747
48- ``` bash 
48+ ``` text 
4949./x test tests/ui 
5050``` 
5151
5252Of course, the choice of test suites is
5353somewhat arbitrary, and may not suit the task you are doing. For example, if you
5454are hacking on debuginfo, you may be better off with the debuginfo test suite:
5555
56- ``` bash 
56+ ``` text 
5757./x test tests/debuginfo 
5858``` 
5959
6060If you only need to test a specific subdirectory of tests for any given test
6161suite, you can pass that directory as a filter to ` ./x test ` :
6262
63- ``` bash 
63+ ``` text 
6464./x test tests/ui/const-generics 
6565``` 
6666
@@ -73,27 +73,27 @@ suite, you can pass that directory as a filter to `./x test`:
7373
7474Likewise, you can test a single file by passing its path:
7575
76- ``` bash 
76+ ``` text 
7777./x test tests/ui/const-generics/const-test.rs 
7878``` 
7979
8080` x `  doesn't support running a single tool test by passing its path yet. You'll
8181have to use the ` --test-args `  argument as described
8282[ below] ( #running-an-individual-test ) .
8383
84- ``` bash 
84+ ``` text 
8585./x test src/tools/miri --test-args tests/fail/uninit/padding-enum.rs 
8686``` 
8787
8888### Run only the tidy script  
8989
90- ``` bash 
90+ ``` text 
9191./x test tidy 
9292``` 
9393
9494### Run tests on the standard library  
9595
96- ``` bash 
96+ ``` text 
9797./x test --stage 0 library/std 
9898``` 
9999
@@ -102,13 +102,13 @@ crates, you have to specify those explicitly.
102102
103103### Run the tidy script and tests on the standard library  
104104
105- ``` bash 
105+ ``` text 
106106./x test --stage 0 tidy library/std 
107107``` 
108108
109109### Run tests on the standard library using a stage 1 compiler  
110110
111- ``` bash 
111+ ``` text 
112112./x test --stage 1 library/std 
113113``` 
114114
@@ -122,7 +122,7 @@ the tests **usually** work fine with stage 1, there are some limitations.
122122
123123### Run all tests using a stage 2 compiler  
124124
125- ``` bash 
125+ ``` text 
126126./x test --stage 2 
127127``` 
128128
@@ -134,13 +134,13 @@ You almost never need to do this; CI will run these tests for you.
134134
135135You may want to run unit tests on a specific file with following:
136136
137- ``` bash 
137+ ``` text 
138138./x test compiler/rustc_data_structures/src/thin_vec/tests.rs 
139139``` 
140140
141141But unfortunately, it's impossible. You should invoke the following instead:
142142
143- ``` bash 
143+ ``` text 
144144./x test compiler/rustc_data_structures/ --test-args thin_vec 
145145``` 
146146
@@ -151,7 +151,7 @@ often the test they are trying to fix. As mentioned earlier, you may pass the
151151full file path to achieve this, or alternatively one may invoke ` x `  with the
152152` --test-args `  option:
153153
154- ``` bash 
154+ ``` text 
155155./x test tests/ui --test-args issue-1234 
156156``` 
157157
@@ -203,7 +203,7 @@ When `--pass $mode` is passed, these tests will be forced to run under the given
203203` $mode `  unless the directive ` //@ ignore-pass `  exists in the test file. For
204204example, you can run all the tests in ` tests/ui `  as ` check-pass ` :
205205
206- ``` bash 
206+ ``` text 
207207./x test tests/ui --pass check 
208208``` 
209209
@@ -219,7 +219,7 @@ first look for expected output in `foo.polonius.stderr`, falling back to the
219219usual ` foo.stderr `  if not found. The following will run the UI test suite in
220220Polonius mode:
221221
222- ``` bash 
222+ ``` text 
223223./x test tests/ui --compare-mode=polonius 
224224``` 
225225
@@ -232,7 +232,7 @@ just `.rs` files, so after [creating a rustup
232232toolchain] ( ../building/how-to-build-and-run.md#creating-a-rustup-toolchain ) , you
233233can do something like:
234234
235- ``` bash 
235+ ``` text 
236236rustc +stage1 tests/ui/issue-1234.rs 
237237``` 
238238
@@ -252,7 +252,7 @@ execution* so be careful where it is used.
252252To do this, first build ` remote-test-server `  for the remote machine, e.g. for
253253RISC-V
254254
255- ``` sh 
255+ ``` text 
256256./x build src/tools/remote-test-server --target riscv64gc-unknown-linux-gnu 
257257``` 
258258
@@ -264,7 +264,7 @@ On the remote machine, run the `remote-test-server` with the `--bind
2642640.0.0.0:12345`  flag (and optionally  ` -v` for verbose output). Output should look
265265like this:
266266
267- ``` sh 
267+ ``` text 
268268$ ./remote-test-server -v --bind 0.0.0.0:12345 
269269starting test server 
270270listening on 0.0.0.0:12345! 
@@ -278,7 +278,7 @@ restrictive IP address when binding.
278278You can test if the ` remote-test-server `  is working by connecting to it and
279279sending ` ping\n ` . It should reply ` pong ` :
280280
281- ``` sh 
281+ ``` text 
282282$ nc $REMOTE_IP 12345 
283283ping 
284284pong 
@@ -288,15 +288,15 @@ To run tests using the remote runner, set the `TEST_DEVICE_ADDR` environment
288288variable then use ` x `  as usual. For example, to run ` ui `  tests for a RISC-V
289289machine with the IP address ` 1.2.3.4 `  use
290290
291- ``` sh 
291+ ``` text 
292292export TEST_DEVICE_ADDR="1.2.3.4:12345" 
293293./x test tests/ui --target riscv64gc-unknown-linux-gnu 
294294``` 
295295
296296If ` remote-test-server `  was run with the verbose flag, output on the test
297297machine may look something like
298298
299- ``` 
299+ ``` text 
300300[...] 
301301run "/tmp/work/test1007/a" 
302302run "/tmp/work/test1008/a" 
@@ -362,21 +362,21 @@ codegen-backends = ["llvm", "gcc"]
362362
363363Then you need to install libgccjit 12. For example with ` apt ` :
364364
365- ``` bash 
366- $  apt install libgccjit-12-dev
365+ ``` text 
366+ apt install libgccjit-12-dev 
367367``` 
368368
369369Now you can run the following command:
370370
371- ``` bash 
372- $  ./x test  compiler/rustc_codegen_gcc/
371+ ``` text 
372+ ./x test compiler/rustc_codegen_gcc/ 
373373``` 
374374
375375If it cannot find the ` .so `  library (if you installed it with ` apt `  for example), you
376376need to pass the library file path with ` LIBRARY_PATH ` :
377377
378- ``` bash 
379- $  LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x test  compiler/rustc_codegen_gcc/
378+ ``` text 
379+ LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x test compiler/rustc_codegen_gcc/ 
380380``` 
381381
382382If you encounter bugs or problems, don't hesitate to open issues on the
0 commit comments