-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Coverage minima: add more fine-grained control
Along with existing statement minimum, add branch minimum. Also, include this pair of control at the package and file level.
- Loading branch information
Albert Meltzer
committed
Feb 18, 2018
1 parent
10db28c
commit cb5abca
Showing
40 changed files
with
450 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.10.4" | ||
|
||
libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test" | ||
|
||
coverageMinimumBranchPerFile := 80 | ||
|
||
coverageFailOnMinimum := true | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} |
14 changes: 14 additions & 0 deletions
14
src/sbt-test/scoverage/bad-coverage-file-branch/project/plugins.sbt
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,14 @@ | ||
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 | ||
} |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/scoverage/bad-coverage-file-branch/src/main/scala/one/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,9 @@ | ||
package one | ||
|
||
object BadCoverage { | ||
|
||
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/bad-coverage-file-branch/src/main/scala/two/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,9 @@ | ||
package two | ||
|
||
object BadCoverage { | ||
|
||
def sum(num1: Int, num2: Int) = { | ||
if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/sbt-test/scoverage/bad-coverage-file-branch/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,17 @@ | ||
import org.specs2.mutable._ | ||
|
||
/** | ||
* Created by tbarke001c on 7/8/14. | ||
*/ | ||
class BadCoverageSpec extends Specification { | ||
|
||
"BadCoverage" should { | ||
"sum two numbers" in { | ||
one.BadCoverage.sum(1, 2) mustEqual 3 | ||
one.BadCoverage.sum(0, 3) mustEqual 3 | ||
one.BadCoverage.sum(3, 0) mustEqual 3 | ||
two.BadCoverage.sum(1, 2) mustEqual 3 | ||
two.BadCoverage.sum(3, 0) mustEqual 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,14 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.10.4" | ||
|
||
libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test" | ||
|
||
coverageMinimumStmtPerFile := 90 | ||
|
||
coverageFailOnMinimum := true | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} |
14 changes: 14 additions & 0 deletions
14
src/sbt-test/scoverage/bad-coverage-file-stmt/project/plugins.sbt
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,14 @@ | ||
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 | ||
} |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/scoverage/bad-coverage-file-stmt/src/main/scala/one/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,9 @@ | ||
package one | ||
|
||
object BadCoverage { | ||
|
||
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/bad-coverage-file-stmt/src/main/scala/two/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,9 @@ | ||
package two | ||
|
||
object BadCoverage { | ||
|
||
def sum(num1: Int, num2: Int) = { | ||
if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/sbt-test/scoverage/bad-coverage-file-stmt/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,16 @@ | ||
import org.specs2.mutable._ | ||
|
||
/** | ||
* Created by tbarke001c on 7/8/14. | ||
*/ | ||
class BadCoverageSpec extends Specification { | ||
|
||
"BadCoverage" should { | ||
"sum two numbers" in { | ||
one.BadCoverage.sum(1, 2) mustEqual 3 | ||
one.BadCoverage.sum(0, 3) mustEqual 3 | ||
one.BadCoverage.sum(3, 0) mustEqual 3 | ||
two.BadCoverage.sum(1, 2) mustEqual 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 |
14 changes: 14 additions & 0 deletions
14
src/sbt-test/scoverage/bad-coverage-package-branch/build.sbt
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,14 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.10.4" | ||
|
||
libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test" | ||
|
||
coverageMinimumBranchPerPackage := 80 | ||
|
||
coverageFailOnMinimum := true | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} |
14 changes: 14 additions & 0 deletions
14
src/sbt-test/scoverage/bad-coverage-package-branch/project/plugins.sbt
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,14 @@ | ||
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 | ||
} |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/scoverage/bad-coverage-package-branch/src/main/scala/one/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,9 @@ | ||
package one | ||
|
||
object BadCoverage { | ||
|
||
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/bad-coverage-package-branch/src/main/scala/two/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,9 @@ | ||
package two | ||
|
||
object BadCoverage { | ||
|
||
def sum(num1: Int, num2: Int) = { | ||
if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/sbt-test/scoverage/bad-coverage-package-branch/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,17 @@ | ||
import org.specs2.mutable._ | ||
|
||
/** | ||
* Created by tbarke001c on 7/8/14. | ||
*/ | ||
class BadCoverageSpec extends Specification { | ||
|
||
"BadCoverage" should { | ||
"sum two numbers" in { | ||
one.BadCoverage.sum(1, 2) mustEqual 3 | ||
one.BadCoverage.sum(0, 3) mustEqual 3 | ||
one.BadCoverage.sum(3, 0) mustEqual 3 | ||
two.BadCoverage.sum(1, 2) mustEqual 3 | ||
two.BadCoverage.sum(0, 3) mustEqual 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 |
14 changes: 14 additions & 0 deletions
14
src/sbt-test/scoverage/bad-coverage-package-stmt/build.sbt
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,14 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.10.4" | ||
|
||
libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test" | ||
|
||
coverageMinimumStmtPerPackage := 80 | ||
|
||
coverageFailOnMinimum := true | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} |
Oops, something went wrong.