-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
193 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
pitest-entry/src/main/java/org/pitest/mutationtest/build/DryRunUnit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.pitest.mutationtest.build; | ||
|
||
import org.pitest.mutationtest.DetectionStatus; | ||
import org.pitest.mutationtest.MutationMetaData; | ||
import org.pitest.mutationtest.MutationResult; | ||
import org.pitest.mutationtest.MutationStatusTestPair; | ||
import org.pitest.mutationtest.engine.MutationDetails; | ||
import org.pitest.util.Log; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.logging.Logger; | ||
import java.util.stream.Collectors; | ||
|
||
public class DryRunUnit implements MutationAnalysisUnit { | ||
private static final Logger LOG = Log.getLogger(); | ||
|
||
private final Collection<MutationDetails> mutations; | ||
|
||
public DryRunUnit(final Collection<MutationDetails> mutations) { | ||
this.mutations = mutations; | ||
} | ||
|
||
@Override | ||
public MutationMetaData call() throws Exception { | ||
LOG.fine("Not analysing " + this.mutations.size() | ||
+ " mutations as in dry run"); | ||
List<MutationResult> results = mutations.stream() | ||
.map(m -> new MutationResult(m, noAnalysis())) | ||
.collect(Collectors.toList()); | ||
return new MutationMetaData(results); | ||
|
||
} | ||
|
||
private MutationStatusTestPair noAnalysis() { | ||
return MutationStatusTestPair.notAnalysed(0, DetectionStatus.NOT_STARTED, Collections.emptyList()); | ||
} | ||
|
||
@Override | ||
public int priority() { | ||
return Integer.MAX_VALUE; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
pitest-entry/src/main/java/org/pitest/mutationtest/config/ExecutionMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.pitest.mutationtest.config; | ||
|
||
public enum ExecutionMode { | ||
NORMAL, DRY_RUN | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.