Crate cargo_test_support
source ·Expand description
§Cargo test support.
See https://rust-lang.github.io/cargo/contrib/ for a guide on writing tests.
WARNING: You might not want to use this outside of Cargo.
- This is designed for testing Cargo itself. Use at your own risk.
- No guarantee on any stability across versions.
- No feature request would be accepted unless proved useful for testing Cargo.
Modules§
- Routines for comparing and diffing output.
- Support for testing using Docker containers.
- Support for cross-compile tests with the
--target
flag. - Common executables that can be reused by various tests.
Macros§
- Declare an expected value for an assert from a file
- Declare an expected value from within Rust source
Structs§
- A cargo project to run tests against.
- Create a project to run tests against
- This is the raw output from the process.
Traits§
- Add a list of arguments as a line
- Test the cargo command
- Enable nightly features for testing
- Establish a process’s test environment
Functions§
- Returns
true
if the local filesystem has low-resolution mtimes. - The error message for ENOENT.
- Helper to retry a function
n
times. - The rustc host such as
x86_64-unknown-linux-gnu
. - The host triple suitable for use in a cargo environment variable (uppercased).
- Some CI setups are much slower then the equipment used by Cargo itself. Architectures that do not have a modern processor, hardware emulation, etc. This provides a way for those setups to increase the cut off for all the time based test.
- Helper that waits for a thread to finish, up to
n
tenths of a second. - Helper that runs some function, and waits up to
n
tenths of a second for it to finish.