Skip to content

Commit ffe4cfd

Browse files
committed
update for review comments
Rename the xtask command to `mdbook-test`. Adjust documentation accordingly. Adjust `OPTIONS`` in xtask.
1 parent ad8504a commit ffe4cfd

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

dev-guide/src/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ When demonstrating success cases, multiple cases may be included in a single cod
2929

3030
## Testing examples
3131

32-
The Rust code blocks are tested in CI. You can verify that the samples pass by running [`mdbook test`].
32+
The Rust code blocks are tested in CI. You can verify that the samples pass by running [`cargo xtask mdbook-test`].
3333

34-
[`mdbook test`]: tests.md#inline-tests
34+
[`cargo xtask mdbook-test`]: tests.md#inline-tests
3535
[mdBook supported languages]: https://rust-lang.github.io/mdBook/format/theme/syntax-highlighting.html#supported-languages
3636
[rustdoc documentation]: https://doc.rust-lang.org/rustdoc/documentation-tests.html
3737
[tested via rustdoc]: tests.md#inline-tests

dev-guide/src/tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
There are several different kinds of tests you can run (these are enforced in CI):
44

55
- [`cargo xtask test-all`](#all-tests) --- Runs all tests.
6-
- [`cargo xtask doctest`](#inline-tests) --- Tests the inline Rust code blocks.
6+
- [`cargo xtask mdbook-test`](#inline-tests) --- Tests the inline Rust code blocks.
77
- [`cargo xtask linkcheck`](#linkcheck) --- Validates that Markdown links aren't broken.
88
- [`cargo xtask style-check`](#style-checks) --- Validates various style checks.
99
- [Code formatting](#code-formatting) --- Checks that all Rust tooling code is formatted.
@@ -22,7 +22,7 @@ We recommend running this as a last step before opening a PR. This runs most of
2222
## Inline tests
2323

2424
```sh
25-
cargo xtask doctest
25+
cargo xtask mdbook-test
2626
```
2727

2828
This command runs all tests that are inline in the Markdown. Internally, this uses [`rustdoc`](https://doc.rust-lang.org/rustdoc/) to run the tests and supports all the same features. Any code block with the `rust` language will be compiled unless it is ignored. See [Examples] for more.

tools/xtask/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Result<T> = std::result::Result<T, Box<dyn Error>>;
88
fn main() -> Result<()> {
99
let mut args = std::env::args().skip(1);
1010
let cmd = args.next();
11-
const OPTIONS: &str = "linkcheck, style-check, test-all";
11+
const OPTIONS: &str = "mdbook-test, linkcheck, style-check, test-all";
1212
match cmd.as_deref() {
1313
Some("test-all") => {
1414
mdbook_test()?;
@@ -18,7 +18,7 @@ fn main() -> Result<()> {
1818
cargo_test()?;
1919
eprintln!("all tests passed!");
2020
}
21-
Some("doctest") => mdbook_test()?,
21+
Some("mdbook-test") => mdbook_test()?,
2222
Some("linkcheck") => linkcheck(args)?,
2323
Some("style-check") => style_check()?,
2424
Some("-h" | "--help") => eprintln!("valid options: {OPTIONS}"),

0 commit comments

Comments
 (0)