diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/build.sbt b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/build.sbt new file mode 100644 index 00000000..a6ecdab4 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/build.sbt @@ -0,0 +1,13 @@ +version := "0.1" + +scalaVersion := "3.3.4" + +libraryDependencies += "org.scalameta" %% "munit" % "1.0.1" % Test + +coverageExcludedFiles := ".*\\/two\\/GoodCoverage;.*\\/three\\/.*" + +resolvers ++= { + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Resolver.sonatypeOssRepos("snapshots") + else Seq.empty +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/GoodCoverage.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/GoodCoverage.scala new file mode 100644 index 00000000..ac6582bb --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/GoodCoverage.scala @@ -0,0 +1,7 @@ +object GoodCoverage { + + def sum(num1: Int, num2: Int) = { + if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/three/GoodCoverage.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/three/GoodCoverage.scala new file mode 100644 index 00000000..260d15a4 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/three/GoodCoverage.scala @@ -0,0 +1,9 @@ +package three + +object GoodCoverage { + + def sum(num1: Int, num2: Int) = { + if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/two/GoodCoverage.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/two/GoodCoverage.scala new file mode 100644 index 00000000..587e11e1 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/two/GoodCoverage.scala @@ -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 + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/test/scala/GoodCoverageSpec.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/test/scala/GoodCoverageSpec.scala new file mode 100644 index 00000000..44eec1c9 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/test/scala/GoodCoverageSpec.scala @@ -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) + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/test b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/test new file mode 100644 index 00000000..ce85327e --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/test @@ -0,0 +1,9 @@ +# run scoverage using the coverage task +> clean +> coverage +> test +> coverageReport +# There should be no directory for the excluded files +$ exists target/scala-3.3.4/scoverage-report/GoodCoverage.scala.html +-$ exists target/scala-3.3.4/scoverage-report/two +-$ exists target/scala-3.3.4/scoverage-report/three diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/build.sbt b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/build.sbt new file mode 100644 index 00000000..429b97c4 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/build.sbt @@ -0,0 +1,13 @@ +version := "0.1" + +scalaVersion := "3.3.4" + +libraryDependencies += "org.scalameta" %% "munit" % "1.0.1" % Test + +coverageExcludedPackages := "two\\..*;three\\..*" + +resolvers ++= { + if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) + Resolver.sonatypeOssRepos("snapshots") + else Seq.empty +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/GoodCoverage.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/GoodCoverage.scala new file mode 100644 index 00000000..ac6582bb --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/GoodCoverage.scala @@ -0,0 +1,7 @@ +object GoodCoverage { + + def sum(num1: Int, num2: Int) = { + if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/three/GoodCoverage.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/three/GoodCoverage.scala new file mode 100644 index 00000000..260d15a4 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/three/GoodCoverage.scala @@ -0,0 +1,9 @@ +package three + +object GoodCoverage { + + def sum(num1: Int, num2: Int) = { + if (0 == num1) num2 else if (0 == num2) num1 else num1 + num2 + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/two/GoodCoverage.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/two/GoodCoverage.scala new file mode 100644 index 00000000..587e11e1 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/two/GoodCoverage.scala @@ -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 + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/test/scala/GoodCoverageSpec.scala b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/test/scala/GoodCoverageSpec.scala new file mode 100644 index 00000000..44eec1c9 --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/test/scala/GoodCoverageSpec.scala @@ -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) + } + +} diff --git a/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/test b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/test new file mode 100644 index 00000000..a7dd274e --- /dev/null +++ b/src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/test @@ -0,0 +1,9 @@ +# run scoverage using the coverage task +> clean +> coverage +> test +> coverageReport +# There should be no directory for the excluded package +$ exists target/scala-3.3.4/scoverage-report/GoodCoverage.scala.html +-$ exists target/scala-3.3.4/scoverage-report/two +-$ exists target/scala-3.3.4/scoverage-report/three