-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Protect compiler directives during mutation #3116
base: master
Are you sure you want to change the base?
Conversation
…_directives # Conflicts: # src/Stryker.Core/Stryker.Core.UnitTest/Mutants/CsharpMutantOrchestratorTests.cs
…es (and revert them on roll back
…ssionmutator and replace it with two extra mutators, add semancticinfo to unit tests
c6e5ac8
to
6826228
Compare
f34711e
to
e9ba29d
Compare
e9ba29d
to
bfec606
Compare
c3017ec
to
80871b8
Compare
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 |
4102df8
to
f5bbfd9
Compare
f5bbfd9
to
df53cc3
Compare
…_directives # Conflicts: # integrationtest/Validation/ValidationProject/ValidateStrykerResults.cs
…into improve_mutation_of_directives
@@ -0,0 +1,2 @@ | |||
|
|||
Console.WriteLine("this is a global statement"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be in https://github.com/stryker-mutator/stryker-net/tree/master/integrationtest/TargetProjects/NetCore/TargetProject/Constructs as a new file called Csharp9_TopLevelStatement.cs
. We are trying to keep an accurate representation of csharp features per language level so that we can easily figure out if we're missing certain constructs in the integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhm now that I say that, is that even possibly or does your entry point have to be top-level as well for this to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should work. An application must have only one entry point. A project can have only one file with top-level statements.
It doesn't state that it has to be a file in the root of the project or with a specific name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well
Now that I have tried to make the change, I know why I did not choose this route. Top level statements are allowed only for executable targets.
Shall I convert the project to output an executable instead of a library assembly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine yes
Quality Gate passedIssues Measures |
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