File tree Expand file tree Collapse file tree 8 files changed +78
-23
lines changed Expand file tree Collapse file tree 8 files changed +78
-23
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,17 @@ following targets of the selected packages:
8686
8787The default behavior can be changed by setting the ` bench ` flag for the target
8888in the manifest settings. Setting examples to ` bench = true ` will build and
89- run the example as a benchmark. Setting targets to ` bench = false ` will stop
90- them from being benchmarked by default. Target selection options that take a
91- target by name ignore the ` bench ` flag and will always benchmark the given
89+ run the example as a benchmark, replacing the example's ` main ` function with
90+ the libtest harness.
91+
92+ Setting targets to ` bench = false ` will stop them from being bencharmked by
93+ default. Target selection options that take a target by name (such as
94+ ` --example foo ` ) ignore the ` bench ` flag and will always benchmark the given
9295target.
9396
97+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
98+ for more information on per-target settings.
99+
94100{{> options-targets-bin-auto-built }}
95101
96102{{> options-targets }}
Original file line number Diff line number Diff line change @@ -89,13 +89,20 @@ following targets of the selected packages:
8989
9090The default behavior can be changed by setting the ` test ` flag for the target
9191in the manifest settings. Setting examples to ` test = true ` will build and run
92- the example as a test. Setting targets to ` test = false ` will stop them from
93- being tested by default. Target selection options that take a target by name
92+ the example as a test, replacing the example's ` main ` function with the
93+ libtest harness. If you don't want the ` main ` function replaced, also include
94+ ` harness = false ` , in which case the example will be built and executed as-is.
95+
96+ Setting targets to ` test = false ` will stop them from being tested by default.
97+ Target selection options that take a target by name (such as ` --example foo ` )
9498ignore the ` test ` flag and will always test the given target.
9599
96100Doc tests for libraries may be disabled by setting ` doctest = false ` for the
97101library in the manifest.
98102
103+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
104+ for more information on per-target settings.
105+
99106{{> options-targets-bin-auto-built }}
100107
101108{{> options-targets }}
Original file line number Diff line number Diff line change @@ -120,10 +120,17 @@ OPTIONS
120120
121121 The default behavior can be changed by setting the bench flag for the
122122 target in the manifest settings. Setting examples to bench = true will
123- build and run the example as a benchmark. Setting targets to bench =
124- false will stop them from being benchmarked by default. Target selection
125- options that take a target by name ignore the bench flag and will always
126- benchmark the given target.
123+ build and run the example as a benchmark, replacing the example’s main
124+ function with the libtest harness.
125+
126+ Setting targets to bench = false will stop them from being bencharmked
127+ by default. Target selection options that take a target by name (such as
128+ --example foo) ignore the bench flag and will always benchmark the given
129+ target.
130+
131+ See Configuring a target
132+ <https://doc.rust-lang.org/cargo/reference/cargo-targets.html#configuring-a-target>
133+ for more information on per-target settings.
127134
128135 Binary targets are automatically built if there is an integration test
129136 or benchmark being selected to benchmark. This allows an integration
Original file line number Diff line number Diff line change @@ -128,14 +128,23 @@ OPTIONS
128128
129129 The default behavior can be changed by setting the test flag for the
130130 target in the manifest settings. Setting examples to test = true will
131- build and run the example as a test. Setting targets to test = false
132- will stop them from being tested by default. Target selection options
133- that take a target by name ignore the test flag and will always test the
134- given target.
131+ build and run the example as a test, replacing the example’s main
132+ function with the libtest harness. If you don’t want the main function
133+ replaced, also include harness = false, in which case the example will
134+ be built and executed as-is.
135+
136+ Setting targets to test = false will stop them from being tested by
137+ default. Target selection options that take a target by name (such as
138+ --example foo) ignore the test flag and will always test the given
139+ target.
135140
136141 Doc tests for libraries may be disabled by setting doctest = false for
137142 the library in the manifest.
138143
144+ See Configuring a target
145+ <https://doc.rust-lang.org/cargo/reference/cargo-targets.html#configuring-a-target>
146+ for more information on per-target settings.
147+
139148 Binary targets are automatically built if there is an integration test
140149 or benchmark being selected to test. This allows an integration test to
141150 execute the binary to exercise and test its behavior. The
Original file line number Diff line number Diff line change @@ -143,11 +143,17 @@ following targets of the selected packages:
143143
144144The default behavior can be changed by setting the ` bench ` flag for the target
145145in the manifest settings. Setting examples to ` bench = true ` will build and
146- run the example as a benchmark. Setting targets to ` bench = false ` will stop
147- them from being benchmarked by default. Target selection options that take a
148- target by name ignore the ` bench ` flag and will always benchmark the given
146+ run the example as a benchmark, replacing the example's ` main ` function with
147+ the libtest harness.
148+
149+ Setting targets to ` bench = false ` will stop them from being bencharmked by
150+ default. Target selection options that take a target by name (such as
151+ ` --example foo ` ) ignore the ` bench ` flag and will always benchmark the given
149152target.
150153
154+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
155+ for more information on per-target settings.
156+
151157Binary targets are automatically built if there is an integration test or
152158benchmark being selected to benchmark. This allows an integration
153159test to execute the binary to exercise and test its behavior.
Original file line number Diff line number Diff line change @@ -146,13 +146,20 @@ following targets of the selected packages:
146146
147147The default behavior can be changed by setting the ` test ` flag for the target
148148in the manifest settings. Setting examples to ` test = true ` will build and run
149- the example as a test. Setting targets to ` test = false ` will stop them from
150- being tested by default. Target selection options that take a target by name
149+ the example as a test, replacing the example's ` main ` function with the
150+ libtest harness. If you don't want the ` main ` function replaced, also include
151+ ` harness = false ` , in which case the example will be built and executed as-is.
152+
153+ Setting targets to ` test = false ` will stop them from being tested by default.
154+ Target selection options that take a target by name (such as ` --example foo ` )
151155ignore the ` test ` flag and will always test the given target.
152156
153157Doc tests for libraries may be disabled by setting ` doctest = false ` for the
154158library in the manifest.
155159
160+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
161+ for more information on per-target settings.
162+
156163Binary targets are automatically built if there is an integration test or
157164benchmark being selected to test. This allows an integration
158165test to execute the binary to exercise and test its behavior.
Original file line number Diff line number Diff line change @@ -145,11 +145,17 @@ available)
145145.sp
146146The default behavior can be changed by setting the \fB bench \fR flag for the target
147147in the manifest settings. Setting examples to \fB bench = true \fR will build and
148- run the example as a benchmark. Setting targets to \fB bench = false \fR will stop
149- them from being benchmarked by default. Target selection options that take a
150- target by name ignore the \fB bench \fR flag and will always benchmark the given
148+ run the example as a benchmark, replacing the example\[cq ] s \fB main \fR function with
149+ the libtest harness.
150+ .sp
151+ Setting targets to \fB bench = false \fR will stop them from being bencharmked by
152+ default. Target selection options that take a target by name (such as
153+ \fB \-\- example foo \fR ) ignore the \fB bench \fR flag and will always benchmark the given
151154target.
152155.sp
156+ See \fI Configuring a target \fR <https://doc.rust\- lang.org/cargo/reference/cargo\- targets.html#configuring\- a\- target>
157+ for more information on per\- target settings.
158+ .sp
153159Binary targets are automatically built if there is an integration test or
154160benchmark being selected to benchmark. This allows an integration
155161test to execute the binary to exercise and test its behavior.
Original file line number Diff line number Diff line change @@ -149,13 +149,20 @@ available)
149149.sp
150150The default behavior can be changed by setting the \fB test \fR flag for the target
151151in the manifest settings. Setting examples to \fB test = true \fR will build and run
152- the example as a test. Setting targets to \fB test = false \fR will stop them from
153- being tested by default. Target selection options that take a target by name
152+ the example as a test, replacing the example\[cq ] s \fB main \fR function with the
153+ libtest harness. If you don\[cq ] t want the \fB main \fR function replaced, also include
154+ \fB harness = false \fR , in which case the example will be built and executed as\- is.
155+ .sp
156+ Setting targets to \fB test = false \fR will stop them from being tested by default.
157+ Target selection options that take a target by name (such as \fB \-\- example foo \fR )
154158ignore the \fB test \fR flag and will always test the given target.
155159.sp
156160Doc tests for libraries may be disabled by setting \fB doctest = false \fR for the
157161library in the manifest.
158162.sp
163+ See \fI Configuring a target \fR <https://doc.rust\- lang.org/cargo/reference/cargo\- targets.html#configuring\- a\- target>
164+ for more information on per\- target settings.
165+ .sp
159166Binary targets are automatically built if there is an integration test or
160167benchmark being selected to test. This allows an integration
161168test to execute the binary to exercise and test its behavior.
You can’t perform that action at this time.
0 commit comments