stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.79k stars 188 forks source link

Protect compiler directives during mutation #3116

Open dupdob opened 4 days ago

dupdob commented 4 days ago

Ensure compiler directives (#if, #pragma....) are not mutated but kept around mutated syntax nodes.

This required small changes in every mutator, as they are not responsible for removing any directive. I took this as an opportunity to improve the design.

Also, added generation of semantic model during mutation tests to ensure mutator related unit tests are relevant. I may have fixed some minor issues on them.

Also added some top level statement in integration test as it was a quick win

FIxes #3081, #3102

dupdob commented 3 days ago

I am happy to see this PR reduces the total number of lines, and it increases the number of mutations. This is probably related to the redesign of the pattern mutator that I modified so it no longer does some internal scan and reenabled orchestration of patterns in general

sonarcloud[bot] commented 3 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
93.4% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud