Cargo looks for integration tests in tests directory next to src.
tests
src
File src/lib.rs:
src/lib.rs
// Define this in a crate called `adder`. pub fn add(a: i32, b: i32) -> i32 { a + b }
File with test: tests/integration_test.rs:
test: tests/integration_test.rs
#[test] fn test_add() { assert_eq!(adder::add(3, 2), 5); }