9 releases (breaking)

0.7.1 Apr 3, 2025
0.7.0 Feb 20, 2025
0.6.0 Jan 9, 2025
0.5.0 Nov 28, 2024
0.1.0 Mar 20, 2024

#263 in Procedural macros

Download history 137/week @ 2025-01-12 206/week @ 2025-01-19 147/week @ 2025-01-26 247/week @ 2025-02-02 127/week @ 2025-02-09 320/week @ 2025-02-16 185/week @ 2025-02-23 142/week @ 2025-03-02 101/week @ 2025-03-09 188/week @ 2025-03-16 133/week @ 2025-03-23 304/week @ 2025-03-30 194/week @ 2025-04-06 99/week @ 2025-04-13 114/week @ 2025-04-20 242/week @ 2025-04-27

670 downloads per month
Used in 5 crates

MIT/Apache

300KB
6.5K SLoC

Cargo test support.

See https://rust-lang.github.io/cargo/contrib/ for a guide on writing tests.

There are two places you can find API documentation

This crate is maintained by the Cargo team, primarily for use by Cargo and not intended for external use. This crate may make major changes to its APIs or be deprecated without warning.

Example

use cargo_test_support::prelude::*;
use cargo_test_support::str;
use cargo_test_support::project;

#[cargo_test]
fn some_test() {
    let p = project()
        .file("src/main.rs", r#"fn main() { println!("hi!"); }"#)
        .build();

    p.cargo("run --bin foo")
        .with_stderr_data(str![[r#"
[COMPILING] foo [..]
[FINISHED] [..]
[RUNNING] `target/debug/foo`
"#]])
        .with_stdout_data(str![["hi!"]])
        .run();
}

This crate is maintained by the Cargo team, primarily for use by Cargo and not intended for external use. This crate may make major changes to its APIs or be deprecated without warning.

Dependencies

~31–45MB
~827K SLoC