forked from szpak/gradle-pitest-plugin
-
Notifications
You must be signed in to change notification settings - Fork 9
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 #70 from koral--/upstream152
Release 0.2.5
- Loading branch information
Showing
18 changed files
with
168 additions
and
47 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
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
21 changes: 21 additions & 0 deletions
21
...ncTest/groovy/pl/droidsonroids/gradle/pitest/functional/TestFixturesFunctionalSpec.groovy
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,21 @@ | ||
package pl.droidsonroids.gradle.pitest.functional | ||
|
||
import groovy.transform.CompileDynamic | ||
import nebula.test.functional.ExecutionResult | ||
|
||
@CompileDynamic | ||
class TestFixturesFunctionalSpec extends AbstractPitestFunctionalSpec { | ||
|
||
void "should work with java-test-fixtures plugin"() { | ||
given: | ||
copyResources("testProjects/testFixtures", "") | ||
when: | ||
ExecutionResult result = runTasks('pitestRelease') | ||
then: | ||
!result.standardError.contains("Build failed with an exception") | ||
!result.failure | ||
result.wasExecuted('pitestRelease') | ||
result.standardOutput.contains('Generated 1 mutations Killed 1 (100%)') | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/funcTest/resources/testProjects/junit5spock2/build.gradle
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,35 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'groovy' | ||
apply plugin: 'info.solidsoft.pitest' | ||
|
||
/* | ||
//Local/current version of the plugin should be put on a classpath earlier to override that plugin version | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:X.Y.Z-SNAPSHOT' | ||
} | ||
} | ||
*/ | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = "pitest.test" | ||
|
||
dependencies { | ||
testImplementation 'org.spockframework:spock-core:2.0-M3-groovy-2.5' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
pitest { | ||
// testPlugin = "junit5" //not needed - 'junit5PluginVersion' should implicitly set it | ||
junit5PluginVersion = "0.12" | ||
} |
1 change: 1 addition & 0 deletions
1
src/funcTest/resources/testProjects/junit5spock2/settings.gradle
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 @@ | ||
rootProject.name = 'simpleSpock2' |
7 changes: 7 additions & 0 deletions
7
src/funcTest/resources/testProjects/junit5spock2/src/main/java/pitest/test/Library.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,7 @@ | ||
package pitest.test; | ||
|
||
public class Library { | ||
public boolean someLibraryMethod() { | ||
return true; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../resources/testProjects/junit5spock2/src/test/groovy/pitest/test/LibrarySpock2Spec.groovy
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,13 @@ | ||
package pitest.test; | ||
|
||
import spock.lang.Specification; | ||
|
||
class LibrarySpock2Spec extends Specification { | ||
|
||
void "should generate some mutation coverage"() { | ||
given: | ||
Library classUnderTest = new Library(); | ||
expect: | ||
classUnderTest.someLibraryMethod() | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/funcTest/resources/testProjects/testFixtures/build.gradle
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,36 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'java-test-fixtures' | ||
apply plugin: 'pl.droidsonroids.pitest' | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
dependencies { | ||
//Local/current version of the plugin should be put on a classpath earlier to override that plugin version | ||
// classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.7-SNAPSHOT' | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = "pitest.test" | ||
|
||
dependencies { | ||
testImplementation 'junit:junit:4.12' | ||
} | ||
|
||
android { | ||
compileSdkVersion 30 | ||
defaultConfig { | ||
minSdkVersion 24 | ||
targetSdkVersion 30 | ||
} | ||
lintOptions { | ||
//ignore missing lint database | ||
abortOnError false | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/funcTest/resources/testProjects/testFixtures/settings.gradle
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 @@ | ||
rootProject.name = 'testFixtures' |
2 changes: 2 additions & 0 deletions
2
src/funcTest/resources/testProjects/testFixtures/src/main/AndroidManifest.xml
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,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="pl.droidsonroids.pitest"/> |
7 changes: 7 additions & 0 deletions
7
src/funcTest/resources/testProjects/testFixtures/src/main/java/pitest/test/Library.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,7 @@ | ||
package pitest.test; | ||
|
||
public class Library { | ||
public boolean someLibraryMethod() { | ||
return true; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/funcTest/resources/testProjects/testFixtures/src/test/java/pitest/test/LibraryTest.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,13 @@ | ||
package pitest.test; | ||
|
||
import org.junit.Test; | ||
import pitest.test.Library; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class LibraryTest { | ||
@Test public void testSomeLibraryMethod() { | ||
Library classUnderTest = new Library(); | ||
assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod()); | ||
} | ||
} |
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