-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1369 from hcoles/feature/dry_run_support
Feature/dry run support
- Loading branch information
Showing
21 changed files
with
264 additions
and
51 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
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
50 changes: 50 additions & 0 deletions
50
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,50 @@ | ||
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; | ||
} | ||
|
||
@Override | ||
public Collection<MutationDetails> mutants() { | ||
return mutations; | ||
} | ||
|
||
} |
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
Oops, something went wrong.