macro_rules! setup {
() => { ... };
}Expand description
Create a builder to configure local test data.
This evaluates to an instance of Setup.
This can be ran in integration tests (and in integration tests only) to ensure that those can be replicated from a source distribution of the package, while actually using additional data stored in your repository. The commit ID of the head, stored inside the package, is used for bit-by-bit reproducibility of the test data.
You can rely on this package only using data within the git tree associated with the commit ID stored in the package. As a tester downstream, if the maintainer of the package signs their crates, and you validate that signature, then by extension and Git’s content addressability all data is ensured to have been signed-off by the maintainer.
When developing locally this checks the plausibility of cargo data and then tries to determine
if git is in use (other VCS are welcome but need to be supported by cargo first).
§Panics
This function panics if any of the following is true:
- The function is called outside of an integration test.
- There is no VCS in use.
- We could not determine how to use the VCS of the repository.
- The repository URL as configured in
Cargo.tomlis not valid. - We could not create a bare repository in the directory
${CARGO_TARGET_TMPDIR}.
When executing from the distribution form of a package, we will also panic if any of the following are true:
- The commit ID that is being read from
.cargo_vcs_info.jsoncan not be fetched from the remote repository. - There is no
.cargo_vcs_info.jsonand the manifest is not in a VCS folder.
Note that the eventual call to build() has some additional panics.