Skip to content

Commit 658221c

Browse files
committed
Document deprecating mdbook test -L
and preferring [rust.manifest] over [rust.edition].
1 parent 9c5dec2 commit 658221c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

guide/src/cli/test.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# The test command
22

33
When writing a book, you may want to provide some code samples,
4-
and it's important that these be accurate.
4+
and it's important that these be kept accurate as your software API evolves.
55
For example,
66
[The Rust Programming Book](https://doc.rust-lang.org/stable/book/) uses a lot
7-
of code samples that could get outdated as the language evolves. Therefore it is very important for
8-
them to be able to automatically test these code examples.
7+
of code samples that could become outdated as the language evolves.
98

10-
mdBook supports a `test` command that will run code samples as doc tests for your book. At
11-
the moment, only Rust doc tests are supported.
9+
MdBook supports a `test` command which runs code samples in your book as doc tests to verify they
10+
will compile, and, optionally, run correctly.
11+
At the moment, mdBook only supports doc *tests* written in Rust, although code samples can be written and *displayed* in many programming languages.
1212

1313
#### Specify a directory
1414

@@ -33,8 +33,8 @@ book using the chapter name or the relative path to the chapter.
3333

3434
#### `--library-path` `[`deprecated`]`
3535

36-
> Note: This argument doesn't provide sufficient extern crate information to run doc tests in current Rust compilers.
37-
Instead, add **manifest** to point to a **Cargo.toml** file in your ***book.toml***, as described in [rust configuration](/format/configuration/general.html#rust-options).
36+
***Note*** This argument is deprecated. Since Rust edition 2018, the compiler needs an explicit `--extern` argument for each external crate used in a doc test, it no longer simply scans the library path for likely-looking crates.
37+
New projects should list external crates as dependencies in a **Cargo.toml** file and reference that file in your ***book.toml***, as described in [rust configuration](/format/configuration/general.html#rust-options).
3838

3939

4040
The `--library-path` (`-L`) option allows you to add directories to the library

0 commit comments

Comments
 (0)