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

#272 in Procedural macros

Download history 197/week @ 2025-01-22 168/week @ 2025-01-29 242/week @ 2025-02-05 107/week @ 2025-02-12 346/week @ 2025-02-19 200/week @ 2025-02-26 82/week @ 2025-03-05 202/week @ 2025-03-12 104/week @ 2025-03-19 181/week @ 2025-03-26 293/week @ 2025-04-02 145/week @ 2025-04-09 106/week @ 2025-04-16 138/week @ 2025-04-23 248/week @ 2025-04-30 170/week @ 2025-05-07

674 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
~833K SLoC

OSZAR »