Skip to content

Commit

Permalink
Note that harness=false enables cfg(test).
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Dec 22, 2019
1 parent c2ff762 commit 493eb34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/doc/src/reference/cargo-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ default is `true` for all targets.
If set to `false`, then you are responsible for defining a `main()` function
to run tests and benchmarks.

Tests have the [`cfg(test)` conditional expression][cfg-test] enabled whether
or not the harness is enabled.

#### The `edition` field

The `edition` field defines the [Rust edition] the target will use. If not
Expand Down Expand Up @@ -353,6 +356,7 @@ autobins = false
[`cargo install`]: ../commands/cargo-install.md
[`cargo run`]: ../commands/cargo-run.md
[`cargo test`]: ../commands/cargo-test.md
[cfg-test]: ../../reference/conditional-compilation.html#test
[crate types]: ../../reference/linkage.html
[crates.io]: https://crates.io/
[customized]: #configuring-a-target
Expand Down

0 comments on commit 493eb34

Please sign in to comment.