@@ -152,6 +152,9 @@ that may use the same attributes. (We could change this by asking
152
152
attributes to be registered in Cargo.toml, but we don't find this
153
153
necessary)
154
154
155
+
156
+ A crate may only define a single post-build context.
157
+
155
158
## Cargo integration
156
159
157
160
Alternative post-build contexts need to integrate with cargo.
@@ -191,23 +194,22 @@ contexts are defined:
191
194
192
195
``` toml
193
196
[post-build .context .test ]
194
- provider = { test = " 1.0" , context = " test " }
197
+ provider = { test = " 1.0" }
195
198
folders = [" tests/" ]
196
199
197
200
[post-build .context .bench ]
198
- provider = { test = " 1.0" , context = " bench" }
199
- folders = [" benchmarks/" ]
201
+ provider = { ?? = "1.0" }
202
+ folders = [" benches/" ]
203
+
204
+ [post-build .context .examples ]
205
+ provider = { ?? = "1.0" }
206
+ folders = [" examples/" ]
200
207
```
201
208
202
209
There's also an ` example ` context defined that just runs the ` main() ` of
203
210
any files given.
204
211
205
- These can be overridden by a crate's ` Cargo.toml ` . The ` context `
206
- property is used to disambiguate when a single crate has multiple
207
- functions tagged ` #[post_build_context] ` (if we were using the example
208
- post-build context further up as a provider, we'd give ` mytest ` here).
209
- ` test ` here is ` libtest ` , though note that it could be maintained
210
- out-of-tree, and shipped with rustup.
212
+ These can be overridden by a crate's ` Cargo.toml ` .
211
213
212
214
To invoke a particular post-build context, a user invokes `cargo context
213
215
<context >` . ` cargo test` and ` cargo bench` are aliases for ` cargo
0 commit comments