llogiq / mutagen

Breaking your Rust code for fun and profit
Apache License 2.0
626 stars 35 forks source link

Feature Request: passing feature flags #154

Open elichai opened 4 years ago

elichai commented 4 years ago

Hi, First this crate is awesome :) Thank you!. Second, In my view there are 2 important features missing to add this to a CI:

  1. Feature gate the mutations, in real code you don't want to risk mutagen affecting the code with regular tests and the compilation overhead. (a naive solution is https://github.com/llogiq/mutagen/compare/master...TheBlueMatt:master a real one involves the ability of passing arbitrary feature flags when running cargo mutagen)

~2. There are some mutations that can't be "fixed" with more tests, because their path isn't really reachable or the mutation doesn't really matter to the function, so a way to add "ignore" to mutations, either with a file (like sanitizers supressions) or with attributes (like #[allow(...)]) that can be also feature gated.~ (opened #156)

Thanks, Elichai.

samuelpilz commented 4 years ago

Thank you for your feedback.

Did I understand your first request correctly: "make it possible to run cargo mutagen --features x,y,z and cargo mutagen --all-features"? I can do that.

The diff also includes a panic when a single mutation is not killed. Insisting on 100% mutation score is not the intention of mutation testing. However, I understand that regressions in mutation score can be caught in CI. Could you open a seperate issue for that?

The topic of skipping a mutations, should also be discussed in a separate issue. I have experimented with some design, but waited for feedback until publishing that featureset.

PS: what version of mutagen are you using?

elichai commented 4 years ago

I agree about the panic, Altough it can make CI's easier if it fails on first mutation (assuming I can skip some)

And I'm currently using master.

samuelpilz commented 4 years ago

The first part is implemented in #155. Would it be possible to open separate issues for the remaining concerns?