chalk icon indicating copy to clipboard operation
chalk copied to clipboard

track test coverage

Open nikomatsakis opened this issue 5 years ago • 3 comments

In #224, @matklad suggested using "test coverage marks" to manually track test coverage:

https://github.com/rust-analyzer/rust-analyzer/blob/ef782adc293deb287128f005dbab2038ba3ccdc1/crates/test_utils/src/marks.rs

This seems like a great idea, although I wonder if we can come up with a better system for test coverage. There is a bit of a complication here in that we want to test (a) that lowering triggered and (b) that the rules that resulted were well tested. This may require some thought!

nikomatsakis avatar Nov 08 '19 10:11 nikomatsakis

We recently re-implemented our coverage marks on top of linker hacks, the UX is quite nice:

https://github.com/rust-analyzer/rust-analyzer/blob/46d4487b8900324fc6a523c8b6ebe036d28fd0fb/crates/test_utils/src/mark.rs

matklad avatar Jul 14 '20 07:07 matklad

Ah, very cool. Is that available in some sort of re-usable crate?

nikomatsakis avatar Jul 17 '20 20:07 nikomatsakis

@nikomatsakis https://github.com/matklad/cov-mark, https://crates.io/crates/cov-mark

though, for rust-analyzer, we use a copy-pasted impl, just because we already have a crate with "assorted test utils".

matklad avatar Jul 17 '20 21:07 matklad