Skip to content

Commit

Permalink
Make note of documentation tests and binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Apr 16, 2015
1 parent 5576b05 commit c776d02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/doc/trpl/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ $ rustdoc --test path/to/my/crate/root.rs
$ cargo test
```

That's right, `cargo test` tests embedded documentation too.
That's right, `cargo test` tests embedded documentation too. However,
`cargo test` will not test binary crates, only library ones. This is
due to the way `rustdoc` works: it links against the library to be tested,
but with a binary, there’s nothing to link to.

There are a few more annotations that are useful to help `rustdoc` do the right
thing when testing your code:
Expand Down

0 comments on commit c776d02

Please sign in to comment.