Skip to content

Commit f8b1760

Browse files
committed
[site] add help text
1 parent aea14df commit f8b1760

File tree

6 files changed

+152
-0
lines changed

6 files changed

+152
-0
lines changed

scripts/regenerate-help-text.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Regenerate the nextest help text displayed on the website.
4+
5+
set -e -o pipefail
6+
7+
cd "$(git rev-parse --show-toplevel)"
8+
mkdir -p site/help-text
9+
cargo nextest list -h > site/help-text/list-help.txt
10+
cargo nextest run -h > site/help-text/run-help.txt

site/help-text/list-help.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
cargo-nextest-list
2+
List tests in workspace
3+
4+
USAGE:
5+
cargo nextest list [OPTIONS] [FILTERS]...
6+
7+
ARGS:
8+
<FILTERS>... Test name filter
9+
10+
OPTIONS:
11+
--manifest-path <PATH> Path to Cargo.toml
12+
-v, --verbose Verbose output
13+
--color <WHEN> Produce color output: auto, always, never [default: auto]
14+
--config-file <PATH> Config file [default: workspace-root/.config/nextest.toml]
15+
-h, --help Print help information
16+
17+
CARGO OPTIONS:
18+
--lib Test only this package's library unit tests
19+
--bin <BIN> Test only the specified binary
20+
--bins Test all binaries
21+
--test <TEST> Test only the specified test target
22+
--tests Test all targets
23+
--bench <BENCH> Test only the specified bench target
24+
--benches Test all benches
25+
--all-targets Test all targets
26+
-p, --package <PACKAGES> Package to test
27+
--workspace Build all packages in the workspace
28+
--exclude <EXCLUDE> Exclude packages from the test
29+
--all Alias for workspace (deprecated)
30+
--release Build artifacts in release mode, with optimizations
31+
--cargo-profile <NAME> Build artifacts with the specified Cargo profile
32+
--build-jobs <JOBS> Number of build jobs to run
33+
--features <FEATURES> Space or comma separated list of features to activate
34+
--all-features Activate all available features
35+
--no-default-features Do not activate the `default` feature
36+
--target <TRIPLE> Build for the target triple
37+
--target-dir <DIR> Directory for all generated artifacts
38+
--ignore-rust-version Ignore `rust-version` specification in packages
39+
--unit-graph Output build graph in JSON (unstable)
40+
--future-incompat-report Outputs a future incompatibility report at the end of the build
41+
(unstable)
42+
--frozen Require Cargo.lock and cache are up to date
43+
--locked Require Cargo.lock is up to date
44+
--offline Run without accessing the network
45+
--config <KEY=VALUE> Override a configuration value (unstable)
46+
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
47+
details
48+
49+
FILTER OPTIONS:
50+
--run-ignored <WHICH> Run ignored tests [default: default] [possible values: default,
51+
ignored-only, all]
52+
--partition <PARTITION> Test partition, e.g. hash:1/2 or count:2/3
53+
54+
OUTPUT OPTIONS:
55+
-T, --message-format <FMT> Output format [default: human] [possible values: human, json,
56+
json-pretty]

site/help-text/run-help.txt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
cargo-nextest-run
2+
Build and run tests
3+
4+
USAGE:
5+
cargo nextest run [OPTIONS] [FILTERS]...
6+
7+
ARGS:
8+
<FILTERS>... Test name filter
9+
10+
OPTIONS:
11+
-P, --profile <PROFILE> Nextest profile to use
12+
--manifest-path <PATH> Path to Cargo.toml
13+
-v, --verbose Verbose output
14+
--color <WHEN> Produce color output: auto, always, never [default: auto]
15+
--config-file <PATH> Config file [default: workspace-root/.config/nextest.toml]
16+
-h, --help Print help information
17+
18+
RUNNER OPTIONS:
19+
-j, --test-threads <THREADS> Number of tests to run simultaneously [default: logical CPU
20+
count] [aliases: jobs]
21+
--retries <RETRIES> Number of retries for failing tests [default: from profile]
22+
--fail-fast Cancel test run on the first failure
23+
--no-fail-fast Run all tests regardless of failure
24+
--no-capture Run tests serially and do not capture output
25+
26+
CARGO OPTIONS:
27+
--lib Test only this package's library unit tests
28+
--bin <BIN> Test only the specified binary
29+
--bins Test all binaries
30+
--test <TEST> Test only the specified test target
31+
--tests Test all targets
32+
--bench <BENCH> Test only the specified bench target
33+
--benches Test all benches
34+
--all-targets Test all targets
35+
-p, --package <PACKAGES> Package to test
36+
--workspace Build all packages in the workspace
37+
--exclude <EXCLUDE> Exclude packages from the test
38+
--all Alias for workspace (deprecated)
39+
--release Build artifacts in release mode, with optimizations
40+
--cargo-profile <NAME> Build artifacts with the specified Cargo profile
41+
--build-jobs <JOBS> Number of build jobs to run
42+
--features <FEATURES> Space or comma separated list of features to activate
43+
--all-features Activate all available features
44+
--no-default-features Do not activate the `default` feature
45+
--target <TRIPLE> Build for the target triple
46+
--target-dir <DIR> Directory for all generated artifacts
47+
--ignore-rust-version Ignore `rust-version` specification in packages
48+
--unit-graph Output build graph in JSON (unstable)
49+
--future-incompat-report Outputs a future incompatibility report at the end of the build
50+
(unstable)
51+
--frozen Require Cargo.lock and cache are up to date
52+
--locked Require Cargo.lock is up to date
53+
--offline Run without accessing the network
54+
--config <KEY=VALUE> Override a configuration value (unstable)
55+
-Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for
56+
details
57+
58+
FILTER OPTIONS:
59+
--run-ignored <WHICH> Run ignored tests [default: default] [possible values: default,
60+
ignored-only, all]
61+
--partition <PARTITION> Test partition, e.g. hash:1/2 or count:2/3
62+
63+
REPORTER OPTIONS:
64+
--failure-output <WHEN> Output stdout and stderr on failure [possible values: immediate,
65+
immediate-final, final, never]
66+
--success-output <WHEN> Output stdout and stderr on success [possible values: immediate,
67+
immediate-final, final, never]
68+
--status-level <LEVEL> Test statuses to output [possible values: none, fail, retry,
69+
slow, pass, skip, all]

site/src/book/listing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ cargo nextest list
1111
![Output of cargo nextest list](../static/nextest-list.png)
1212

1313
[^doctest]: Doctests are currently [not supported](https://github.com/nextest-rs/nextest/issues/16) because of limitations in stable Rust.
14+
15+
## Options and arguments
16+
17+
```
18+
{{#include ../../help-text/list-help.txt}}
19+
```

site/src/book/other-options.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
Some other options accepted by `cargo nextest run`:
44

5+
### Runner options
56
* `--no-fail-fast`: do not exit the test run on the first failure. Most useful for CI scenarios.
67
* `-j, --test-threads`: number of tests to run simultaneously. Note that this is separate from the number of build jobs to run simultaneously, which is specified by `--build-jobs`.
78
* `--run-ignored ignored-only` runs ignored tests, while `--run-ignored all` runs both ignored and non-ignored tests.
9+
10+
### Reporter options
811
* `--failure-output` and `--success-output` control when standard output and standard error are displayed for failing and passing tests, respectively. The possible values are:
912
* `immediate`: display output as soon as the test fails. Default for `--failure-output`.
1013
* `final`: display output at the end of the test run.
1114
* `immediate-final`: display output as soon as the test fails, and at the end of the run. This is most useful for CI runs.
1215
* `never`: never display output. Default for `--success-output`.
1316
* `--status-level`: which test statuses (**PASS**, **FAIL** etc) to display. There are 7 status levels: `none, fail, retry, slow, pass, skip, all`. Each status level causes all earlier status levels to be displayed as well. (For example, setting `status-level` to `skip` will show failing, retried, slow and passing tests along with skipped tests.) The default is `pass`.
17+
18+
For a full list of options, see [Options and arguments](running.md#options-and-arguments).

site/src/book/running.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@ cargo nextest run --no-capture
4848
In this mode, cargo-nextest will run tests *serially* so that output from different tests isn't interspersed. This is different from `cargo test -- --nocapture`, which will run tests in parallel.
4949

5050
[^doctest]: Doctests are currently [not supported](https://github.com/nextest-rs/nextest/issues/16) because of limitations in stable Rust.
51+
52+
## Options and arguments
53+
54+
```
55+
{{#include ../../help-text/run-help.txt}}
56+
```

0 commit comments

Comments
 (0)