Support `#[path]` attributes in module filtering
enhancement
Consider the following code in a `src/lib.rs`
```rust
#[cfg(test)]
mod tests {
#[path = "./other.rs"]
mod oopsy;
}
```
We'd look for a `./tests/oopsy/` or `./tests/oopsy.rs`. If it's not in a `src/lib.rs` but say `src/foo.rs` we'd be looking for `./foo/tests/oopsy/` or `./foo/tests/oppsy.rs`. However the real file to ignore when excluding tests is `./other.rs`.
Add handling of the path attribute on modules to tarpaulin's source analysis. This may also be present in relative paths with `../`. For full marks should make sure we don't filter out source files with relative paths that put them in a place we'd filter out other source. For extra horrible edge-case a module which maps into a folder which is excluded as test code but this file isn't part of that module it's just following a path directive 😵
关闭于 2026-04-07 0 条评论