Cargo test internal packages

Ok, here is how I did it(don't know if there is a nicer solution):

[[test]]
name = "test_cionc_parser"
path = "src/parser/lib.rs"

[[test]]
name = "test_cionc_utils"
path = "src/utils/lib.rs"

That's in the root Cargo.toml. You basically tell it to create tests for the other crates.

Edit, removed:

[[test]]
name = "test_cionc"
path = "src/main.rs"

since it already creates and runs a test for this.

3 Likes