8 releases (breaking)

0.7.0 Feb 20, 2025
0.6.0 Jan 9, 2025
0.5.0 Nov 28, 2024
0.4.0 Oct 17, 2024
0.1.0 Mar 20, 2024

#241 in Procedural macros

Download history 124/week @ 2024-12-05 187/week @ 2024-12-12 84/week @ 2024-12-19 62/week @ 2024-12-26 95/week @ 2025-01-02 287/week @ 2025-01-09 136/week @ 2025-01-16 194/week @ 2025-01-23 182/week @ 2025-01-30 243/week @ 2025-02-06 93/week @ 2025-02-13 349/week @ 2025-02-20 196/week @ 2025-02-27 83/week @ 2025-03-06 215/week @ 2025-03-13 77/week @ 2025-03-20

590 downloads per month
Used in 6 crates

MIT/Apache

300KB
6.5K SLoC

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.


lib.rs:

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();
}

Dependencies

~31–45MB
~829K SLoC