From 41beaf41c321c72a0ef92e168d0e3cb9f2e3a314 Mon Sep 17 00:00:00 2001 From: Adwin White Date: Fri, 20 Sep 2024 14:37:17 +0800 Subject: [PATCH] Emphasize how to run a single tool test --- src/tests/intro.md | 4 ++++ src/tests/running.md | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/tests/intro.md b/src/tests/intro.md index 4ed5fb69a..d0c718d5c 100644 --- a/src/tests/intro.md +++ b/src/tests/intro.md @@ -124,6 +124,10 @@ To run the tool's tests, just pass its path to `./x test`. Usually these tools involve running `cargo test` within the tool's directory. +If you want to run only a specified set of tests, append `--test-args FILTER_NAME` to the command. + +> Example: `./x test src/tools/miri --test-args padding` + In CI, some tools are allowed to fail. Failures send notifications to the corresponding teams, and is tracked on the [toolstate website]. More information can be found in the [toolstate documentation]. diff --git a/src/tests/running.md b/src/tests/running.md index 395d5dc7e..a081d3db4 100644 --- a/src/tests/running.md +++ b/src/tests/running.md @@ -62,6 +62,13 @@ Likewise, you can test a single file by passing its path: ./x test tests/ui/const-generics/const-test.rs ``` +`x` doesn't support running a single tool test by passing its path yet. +You'll have to use the `--test-args` argument as describled [below](#running-an-individual-test). + +```bash +./x test src/tools/miri --test-args tests/fail/uninit/padding-enum.rs +``` + ### Run only the tidy script ```bash