You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/src/cli/test.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,9 @@ For example,
7
7
of code samples that could become outdated as the language evolves.
8
8
9
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.
10
+
will compile, and, optionally, run correctly.
11
+
For details on how to specify the test to be done and outcome to be expected, see [Code Blocks](/format/mdbook.md#code-blocks).
12
+
11
13
At the moment, mdBook only supports doc *tests* written in Rust, although code samples can be written and *displayed* in many programming languages.
12
14
13
15
#### Specify a directory
@@ -36,7 +38,6 @@ book using the chapter name or the relative path to the chapter.
36
38
***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
39
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).
38
40
39
-
40
41
The `--library-path` (`-L`) option allows you to add directories to the library
41
42
search path used by `rustdoc` when it builds and tests the examples. Multiple
42
43
directories can be specified with multiple options (`-L foo -L bar`) or with a
Copy file name to clipboardExpand all lines: guide/src/format/mdbook.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# mdBook-specific features
2
2
3
-
# Features for code blocks
3
+
# Code blocks
4
4
5
-
These capabilities primarily affect how the user sees or interacts with code samples in your book and are supported directly by mdBook. Some also affect documentation tests (for which mdBook invokes `rustdoc --test`): this is detailed in the sections below.
5
+
These capabilities primarily affect how the user sees or interacts with code samples in your book and are supported directly by mdBook. Some also affect running the sample as a documentation test. (for which mdBook invokes `rustdoc --test`), so : this is detailed in the sections below.
6
6
7
7
## Hiding code lines
8
8
@@ -12,7 +12,7 @@ For the Rust language, you can use the `#` character as a prefix which will hide
0 commit comments