Add basic docs for the new `aux-bin` header (#1942)

This commit is contained in:
Martin Nordholts 2024-04-06 22:01:03 +02:00 committed by GitHub
parent 0b6f21054a
commit b735c7e9b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -501,10 +501,11 @@ only running the main `coverage` suite.
## Building auxiliary crates ## Building auxiliary crates
It is common that some tests require additional auxiliary crates to be compiled. It is common that some tests require additional auxiliary crates to be compiled.
There are two [headers](headers.md) to assist with that: There are three [headers](headers.md) to assist with that:
* `aux-build` * `aux-build`
* `aux-crate` * `aux-crate`
* `aux-bin`
`aux-build` will build a separate crate from the named source file. `aux-build` will build a separate crate from the named source file.
The source file should be in a directory called `auxiliary` beside the test file. The source file should be in a directory called `auxiliary` beside the test file.
@ -529,6 +530,10 @@ For example, `// aux-crate:foo=bar.rs` will compile `auxiliary/bar.rs` and
make it available under then name `foo` within the test. make it available under then name `foo` within the test.
This is similar to how Cargo does dependency renaming. This is similar to how Cargo does dependency renaming.
`aux-bin` is similar to `aux-build` but will build a binary instead of a
library. The binary will be available in `auxiliary/bin` relative to the working
directory of the test.
### Auxiliary proc-macro ### Auxiliary proc-macro
If you want a proc-macro dependency, then there currently is some ceremony If you want a proc-macro dependency, then there currently is some ceremony