Skip to content
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

allow multiple mutations per mutator #1188

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
public class DefaultTestPrioritiser implements TestPrioritiser {

private static final int TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS = 1000;
private static final int TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS = 1000;

private final CoverageDatabase coverage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public Mutant getMutation(final MutationIdentifier id) {
this.computeCache, FrameOptions.pickFlags(bytes.get()));
final MutatingClassVisitor mca = new MutatingClassVisitor(w, context,
filterMethods(), FCollection.filter(this.mutators,
isMutatorFor(id)));
m -> m.isMutatorFor(id)));
reader.accept(mca, ClassReader.EXPAND_FRAMES);

final List<MutationDetails> details = context.getMutationDetails(context
Expand All @@ -112,11 +112,6 @@ public Mutant getMutation(final MutationIdentifier id) {

}

private static Predicate<MethodMutatorFactory> isMutatorFor(
final MutationIdentifier id) {
return a -> id.getMutator().equals(a.getGloballyUniqueId());
}

private Predicate<MethodInfo> filterMethods() {
return and(this.filter, filterSyntheticMethods());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.pitest.mutationtest.engine.gregor;

import org.objectweb.asm.MethodVisitor;
import org.pitest.mutationtest.engine.MutationIdentifier;
import org.pitest.plugin.ClientClasspathPlugin;

/**
Expand Down Expand Up @@ -61,4 +62,8 @@ default String description() {
return getName();
}

default boolean isMutatorFor(MutationIdentifier id) {
return id.getMutator().equals(getGloballyUniqueId());
}

}