./x test src/tools/miri --test-args tests/fail/uninit/padding-enum.rs
```
### Run only the tidy script
```text
./x test tidy
```
### Run tests on the standard library
```text
./x test --stage 0 library/std
```
Note that this only runs tests on `std`; if you want to test `core` or other
crates, you have to specify those explicitly.
### Run the tidy script and tests on the standard library
```text
./x test --stage 0 tidy library/std
```
### Run tests on the standard library using a stage 1 compiler
```text
./x test --stage 1 library/std
```
By listing which test suites you want to run,
you avoid having to run tests for components you did not change at all.
<div class="warning">
Note that bors only runs the tests with the full stage 2 build; therefore, while
the tests **usually** work fine with stage 1, there are some limitations.
</div>
### Run all tests using a stage 2 compiler
```text
./x test --stage 2
```
<div class="warning">
You almost never need to do this; CI will run these tests for you.
</div>
## Run unit tests on the compiler/library
You may want to run unit tests on a specific file with following:
```text
./x test compiler/rustc_data_structures/src/thin_vec/tests.rs
```
But unfortunately, it's impossible. You should invoke the following instead:
```text
./x test compiler/rustc_data_structures/ --test-args thin_vec
```
## Running an individual test
Another common thing that people want to do is to run an **individual test**,
often the test they are trying to fix. As mentioned earlier, you may pass the
full file path to achieve this, or alternatively one may invoke `x` with the
`--test-args` option:
```text
./x test tests/ui --test-args issue-1234
```
Under the hood, the test runner invokes the standard Rust test runner (the same
one you get with `#[test]`), so this command would wind up filtering for tests
that include "issue-1234" in the name. Thus, `--test-args` is a good way to run
a collection of related tests.
## Passing arguments to `rustc` when running tests
It can sometimes be useful to run some tests with specific compiler arguments,
without using `RUSTFLAGS` (during development of unstable features, with `-Z`
flags, for example).
This can be done with `./x test`'s `--compiletest-rustc-args` option, to pass
additional arguments to the compiler when building the tests.
## Editing and updating the reference files
If you have changed the compiler's output intentionally, or you are making a new
test, you can pass `--bless` to the test subcommand.
As an example,
if some tests in `tests/ui` are failing, you can run this command:
```text
./x test tests/ui --bless
```
It automatically adjusts the `.stderr`, `.stdout`, or `.fixed` files of all `test/ui` tests.
Of course you can also target just specific tests with the `--test-args your_test_name` flag,
just like when running the tests without the `--bless` flag.
## Configuring test running
There are a few options for running tests:
* `bootstrap.toml` has the `rust.verbose-tests` option. If `false`, each test will
print a single dot (the default). If `true`, the name of every test will be
printed. This is equivalent to the `--quiet` option in the [Rust test
harness](https://doc.rust-lang.org/rustc/tests/).
* The environment variable `RUST_TEST_THREADS` can be set to the number of
concurrent threads to use for testing.
## Passing `--pass $mode`
Pass UI tests now have three modes, `check-pass`, `build-pass` and `run-pass`.
When `--pass $mode` is passed, these tests will be forced to run under the given
`$mode` unless the directive `//@ ignore-pass` exists in the test file. For
example, you can run all the tests in `tests/ui` as `check-pass`:
```text
./x test tests/ui --pass check
```
By passing `--pass $mode`, you can reduce the testing time. For each mode,
please see [Controlling pass/fail
expectations](ui.md#controlling-passfail-expectations).
## Running tests with different "compare modes"
UI tests may have different output depending on certain "modes" that the