-
Notifications
You must be signed in to change notification settings - Fork 155
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
1 parent
5af259b
commit 47458fb
Showing
12 changed files
with
137 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "3.2.0-RC1-bin-20220523-6783853-NIGHTLY" // TODO: Should be updated to stable version on 3.2.0-RC1 release | ||
|
||
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test | ||
|
||
coverageMinimum := 80 | ||
|
||
coverageFailOnMinimum := true | ||
|
||
coverageEnabled := true | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) | ||
Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} |
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,16 @@ | ||
val pluginVersion = sys.props.getOrElse( | ||
"plugin.version", | ||
throw new RuntimeException( | ||
"""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin | ||
) | ||
) | ||
|
||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % pluginVersion) | ||
|
||
resolvers ++= { | ||
if (pluginVersion.endsWith("-SNAPSHOT")) | ||
Seq(Resolver.sonatypeRepo("snapshots")) | ||
else | ||
Seq.empty | ||
} |
10 changes: 10 additions & 0 deletions
10
src/sbt-test/scoverage/scala3-bad/src/main/scala/BadCoverage.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
object BadCoverage { | ||
|
||
def sum(num1: Int, num2: Int) = { | ||
num1 + num2 | ||
} | ||
|
||
def mult(num1: Int, num2: Int) = { | ||
num1 * num2 | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/sbt-test/scoverage/scala3-bad/src/test/scala/BadCoverageSpec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import munit.FunSuite | ||
|
||
/** Created by tbarke001c on 7/8/14. | ||
*/ | ||
class BadCoverageSpec extends FunSuite { | ||
|
||
test("BadCoverage should sum two numbers") { | ||
assertEquals(BadCoverage.sum(1, 2), 3) | ||
} | ||
} |
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 @@ | ||
# run scoverage | ||
> clean | ||
> coverage | ||
> test | ||
-> coverageReport |
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 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "3.2.0-RC1-bin-20220523-6783853-NIGHTLY" // TODO: Should be updated to stable version on 3.2.0-RC1 release | ||
|
||
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test | ||
|
||
coverageMinimum := 80 | ||
coverageMinimumStmtTotal := 100 | ||
coverageMinimumBranchTotal := 100 | ||
coverageMinimumStmtPerPackage := 100 | ||
coverageMinimumBranchPerPackage := 100 | ||
coverageMinimumStmtPerFile := 100 | ||
coverageMinimumBranchPerFile := 100 | ||
|
||
coverageFailOnMinimum := true | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) | ||
Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} |
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,16 @@ | ||
val pluginVersion = sys.props.getOrElse( | ||
"plugin.version", | ||
throw new RuntimeException( | ||
"""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin | ||
) | ||
) | ||
|
||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % pluginVersion) | ||
|
||
resolvers ++= { | ||
if (pluginVersion.endsWith("-SNAPSHOT")) | ||
Seq(Resolver.sonatypeRepo("snapshots")) | ||
else | ||
Seq.empty | ||
} |
7 changes: 7 additions & 0 deletions
7
src/sbt-test/scoverage/scala3-good/src/main/scala/GoodCoverage.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
object GoodCoverage { | ||
|
||
def sum(num1: Int, num2: Int) = { | ||
if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/scoverage/scala3-good/src/main/scala/two/GoodCoverage.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package two | ||
|
||
object GoodCoverage { | ||
|
||
def sum(num1: Int, num2: Int) = { | ||
if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/sbt-test/scoverage/scala3-good/src/test/scala/GoodCoverageSpec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import munit.FunSuite | ||
|
||
/** Created by tbarke001c on 7/8/14. | ||
*/ | ||
class GoodCoverageSpec extends FunSuite { | ||
|
||
test("GoodCoverage should sum two numbers") { | ||
assertEquals(GoodCoverage.sum(1, 2), 3) | ||
assertEquals(GoodCoverage.sum(0, 3), 3) | ||
assertEquals(GoodCoverage.sum(3, 0), 3) | ||
} | ||
|
||
test("two.GoodCoverage should sum two numbers") { | ||
assertEquals(two.GoodCoverage.sum(1, 2), 3) | ||
assertEquals(two.GoodCoverage.sum(0, 3), 3) | ||
assertEquals(two.GoodCoverage.sum(3, 0), 3) | ||
} | ||
|
||
} |
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 @@ | ||
# run scoverage | ||
> clean | ||
> coverage | ||
> test | ||
> coverageReport |