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:
86
86
87
87
The default behavior can be changed by setting the ` bench ` flag for the target
88
88
in 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
92
95
target.
93
96
97
+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
98
+ for more information on per-target settings.
99
+
94
100
{{> options-targets-bin-auto-built }}
95
101
96
102
{{> options-targets }}
Original file line number Diff line number Diff line change @@ -89,13 +89,20 @@ following targets of the selected packages:
89
89
90
90
The default behavior can be changed by setting the ` test ` flag for the target
91
91
in 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 ` )
94
98
ignore the ` test ` flag and will always test the given target.
95
99
96
100
Doc tests for libraries may be disabled by setting ` doctest = false ` for the
97
101
library in the manifest.
98
102
103
+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
104
+ for more information on per-target settings.
105
+
99
106
{{> options-targets-bin-auto-built }}
100
107
101
108
{{> options-targets }}
Original file line number Diff line number Diff line change @@ -120,10 +120,17 @@ OPTIONS
120
120
121
121
The default behavior can be changed by setting the bench flag for the
122
122
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.
127
134
128
135
Binary targets are automatically built if there is an integration test
129
136
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
128
128
129
129
The default behavior can be changed by setting the test flag for the
130
130
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.
135
140
136
141
Doc tests for libraries may be disabled by setting doctest = false for
137
142
the library in the manifest.
138
143
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
+
139
148
Binary targets are automatically built if there is an integration test
140
149
or benchmark being selected to test. This allows an integration test to
141
150
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:
143
143
144
144
The default behavior can be changed by setting the ` bench ` flag for the target
145
145
in 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
149
152
target.
150
153
154
+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
155
+ for more information on per-target settings.
156
+
151
157
Binary targets are automatically built if there is an integration test or
152
158
benchmark being selected to benchmark. This allows an integration
153
159
test 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:
146
146
147
147
The default behavior can be changed by setting the ` test ` flag for the target
148
148
in 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 ` )
151
155
ignore the ` test ` flag and will always test the given target.
152
156
153
157
Doc tests for libraries may be disabled by setting ` doctest = false ` for the
154
158
library in the manifest.
155
159
160
+ See [ Configuring a target] ( ../reference/cargo-targets.html#configuring-a-target )
161
+ for more information on per-target settings.
162
+
156
163
Binary targets are automatically built if there is an integration test or
157
164
benchmark being selected to test. This allows an integration
158
165
test 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)
145
145
.sp
146
146
The default behavior can be changed by setting the \fB bench \fR flag for the target
147
147
in 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
151
154
target.
152
155
.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
153
159
Binary targets are automatically built if there is an integration test or
154
160
benchmark being selected to benchmark. This allows an integration
155
161
test 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)
149
149
.sp
150
150
The default behavior can be changed by setting the \fB test \fR flag for the target
151
151
in 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 )
154
158
ignore the \fB test \fR flag and will always test the given target.
155
159
.sp
156
160
Doc tests for libraries may be disabled by setting \fB doctest = false \fR for the
157
161
library in the manifest.
158
162
.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
159
166
Binary targets are automatically built if there is an integration test or
160
167
benchmark being selected to test. This allows an integration
161
168
test to execute the binary to exercise and test its behavior.
You can’t perform that action at this time.
0 commit comments