From 5dec8508c7421f7579aae321cb3d08739313d836 Mon Sep 17 00:00:00 2001 From: josh rotenberg Date: Thu, 24 Jun 2021 19:08:23 -0700 Subject: [PATCH] clarify the library path documentation --- guide/src/cli/test.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/guide/src/cli/test.md b/guide/src/cli/test.md index c13e8809..63245e9d 100644 --- a/guide/src/cli/test.md +++ b/guide/src/cli/test.md @@ -43,7 +43,17 @@ mdbook test path/to/book The `--library-path` (`-L`) option allows you to add directories to the library search path used by `rustdoc` when it builds and tests the examples. Multiple directories can be specified with multiple options (`-L foo -L bar`) or with a -comma-delimited list (`-L foo,bar`). +comma-delimited list (`-L foo,bar`). The path should point to the Cargo +[build cache](https://doc.rust-lang.org/cargo/guide/build-cache.html)'s `deps` directory that +contains the build output of your project. For example, if your Rust project's book is in a directory +named `my-book`, the following command would include the crate's dependencies when running `test`: + +```shell +mdbook test my-book -L target/debug/deps/ +``` + +See the `rustdoc` command-line [documentation](https://doc.rust-lang.org/rustdoc/command-line-arguments.html#-l--library-path-where-to-look-for-dependencies) +for more information. #### --dest-dir