Skip to main content

missing_inline_tests

Function missing_inline_tests 

Source
pub fn missing_inline_tests(
    root: impl AsRef<Path>,
    exempt: &BTreeSet<String>,
) -> Result<Vec<PathBuf>>
Expand description

Walk root for Rust source files and return every one that defines testable behavior — a function with a body, outside any #[cfg(test)] module — but carries no inline #[cfg(test)] module, sorted for deterministic output.

The Rust arm of the colocated-test rule (#40): Rust units are inline #[cfg(test)] modules, so “colocated” means a test module in the same file, not a sibling file. A file with no testable function (only mod / use declarations, types, or constants) is not a subject; integration crates under tests/ (and benches/ / examples/) are not unit sources and are skipped; a file whose root-relative path is in exempt is a deliberate, reason-required omission. Errors if the tree can’t be read or a file can’t be parsed.