-
Notifications
You must be signed in to change notification settings - Fork 42
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 #205 from msigmond/master
Add support for excludedFiles and excludedPackages for Scala 3
- Loading branch information
Showing
16 changed files
with
150 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionSha256Sum=e111cb9948407e26351227dabce49822fb88c37ee72f1d1582a69c68af2e702f | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
6 changes: 3 additions & 3 deletions
6
...rossScalaVersionTest/resources/projects/scala-multi-module-cross-version/3_2/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
dependencies { | ||
implementation 'org.scala-lang:scala3-library_3:3.2.0' | ||
testImplementation 'org.scalatest:scalatest_3:3.2.14' | ||
testImplementation "org.scalatestplus:junit-4-13_3:3.2.14.0" | ||
implementation 'org.scala-lang:scala3-library_3:3.4.2' | ||
testImplementation 'org.scalatest:scalatest_3:3.2.16' | ||
testImplementation "org.scalatestplus:junit-4-13_3:3.2.16.0" | ||
} |
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
57 changes: 57 additions & 0 deletions
57
src/functionalTest/java/org/scoverage/ScalaSingleModuleTestScala3.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,57 @@ | ||
package org.scoverage; | ||
|
||
import org.junit.Assert; | ||
|
||
import java.util.List; | ||
|
||
public class ScalaSingleModuleTestScala3 extends ScalaSingleModuleTest { | ||
|
||
@Override | ||
protected List<String> getVersionAgruments() { | ||
return ScalaVersionArguments.version3; | ||
} | ||
|
||
@Override | ||
public void checkScoverage() throws Exception { | ||
AssertableBuildResult result = run("clean", ScoveragePlugin.getCHECK_NAME()); | ||
|
||
result.assertTaskSucceeded(ScoveragePlugin.getCOMPILE_NAME()); | ||
result.assertTaskSucceeded(ScoveragePlugin.getREPORT_NAME()); | ||
result.assertTaskSucceeded(ScoveragePlugin.getCHECK_NAME()); | ||
result.assertTaskDoesntExist(ScoveragePlugin.getAGGREGATE_NAME()); | ||
|
||
assertReportFilesExist(); | ||
assertCoverage(66.67); | ||
} | ||
|
||
@Override | ||
public void reportScoverageWithExcludedClasses() throws Exception { | ||
AssertableBuildResult result = run("clean", ScoveragePlugin.getREPORT_NAME(), | ||
"-PexcludedFile=.*"); | ||
|
||
result.assertTaskSucceeded(ScoveragePlugin.getCOMPILE_NAME()); | ||
result.assertTaskSucceeded(ScoveragePlugin.getREPORT_NAME()); | ||
result.assertTaskDoesntExist(ScoveragePlugin.getCHECK_NAME()); | ||
result.assertTaskDoesntExist(ScoveragePlugin.getAGGREGATE_NAME()); | ||
|
||
Assert.assertTrue(resolve(reportDir(), "index.html").exists()); | ||
Assert.assertFalse(resolve(reportDir(), "org/hello/World.scala.html").exists()); | ||
assertCoverage(100.0); // coverage is 100 since no classes are covered | ||
|
||
// compiled class should exist in the default classes directory, but not in scoverage | ||
Assert.assertTrue(resolve(buildDir(), "classes/scala/main/org/hello/World.class").exists()); | ||
} | ||
|
||
@Override | ||
public void reportScoverageWithoutNormalCompilationAndWithExcludedClasses() throws Exception { | ||
AssertableBuildResult result = run("clean", ScoveragePlugin.getREPORT_NAME(), | ||
"-PexcludedFile=.*", "-P" + ScoveragePlugin.getSCOVERAGE_COMPILE_ONLY_PROPERTY()); | ||
|
||
Assert.assertTrue(resolve(reportDir(), "index.html").exists()); | ||
Assert.assertFalse(resolve(reportDir(), "org/hello/World.scala.html").exists()); | ||
assertCoverage(100.0); // coverage is 100 since no classes are covered | ||
|
||
// compiled class should exist in the default classes directory, but not in scoverage | ||
Assert.assertTrue(resolve(buildDir(), "classes/scala/main/org/hello/World.class").exists()); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/functionalTest/java/org/scoverage/ScalaVersionArguments.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,33 @@ | ||
package org.scoverage; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public interface ScalaVersionArguments { | ||
List<String> version2WithLegacyScalatest = Arrays.asList( | ||
"-PscalaVersionMajor=2", | ||
"-PscalaVersionMinor=13", | ||
"-PscalaVersionBuild=14", | ||
"-PjunitVersion=5.3.2", | ||
"-PjunitPlatformVersion=1.3.2", | ||
"-PscalatestVersion=3.0.8" | ||
); | ||
|
||
List<String> version2 = Arrays.asList( | ||
"-PscalaVersionMajor=2", | ||
"-PscalaVersionMinor=13", | ||
"-PscalaVersionBuild=14", | ||
"-PjunitVersion=5.3.2", | ||
"-PjunitPlatformVersion=1.3.2", | ||
"-PscalatestVersion=3.2.16" | ||
); | ||
|
||
List<String> version3 = Arrays.asList( | ||
"-PscalaVersionMajor=3", | ||
"-PscalaVersionMinor=4", | ||
"-PscalaVersionBuild=2", | ||
"-PjunitVersion=5.3.2", | ||
"-PjunitPlatformVersion=1.3.2", | ||
"-PscalatestVersion=3.2.16" | ||
); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...functionalTest/resources/projects/detect-scala-library/dependency-management/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
2 changes: 1 addition & 1 deletion
2
src/functionalTest/resources/projects/scala-single-module-dependency-manager/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
2 changes: 1 addition & 1 deletion
2
src/functionalTest/resources/projects/scala-single-module-multiple-test-tasks/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
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
6 changes: 3 additions & 3 deletions
6
...st/resources/projects/scala-single-module/src/test/scala/org/hello/TestNothingSuite.scala
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
6 changes: 3 additions & 3 deletions
6
...onalTest/resources/projects/scala-single-module/src/test/scala/org/hello/WorldSuite.scala
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