-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh excluding packages and files #443
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.13.6" | ||
|
||
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test | ||
|
||
coverageExcludedFiles := ".*\\/two\\/GoodCoverage" | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) | ||
Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.6.2 |
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 | ||
} |
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 | ||
} | ||
|
||
} |
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 | ||
} | ||
|
||
} |
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) | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# run scoverage using the coverage task | ||
> clean | ||
> coverage | ||
> test | ||
> coverageReport | ||
# There should be no directory for the excluded files | ||
-$ exists target/scala-2.13/scoverage-report/two |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.13.6" | ||
|
||
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test | ||
|
||
coverageExcludedPackages := "two\\..*" | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) | ||
Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding test for |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.6.2 |
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 | ||
} |
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 | ||
} | ||
|
||
} |
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 | ||
} | ||
|
||
} |
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) | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# run scoverage using the coverage task | ||
> clean | ||
> coverage | ||
> test | ||
> coverageReport | ||
# There should be no directory for the excluded package | ||
-$ exists target/scala-2.13/scoverage-report/two |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.6.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
> coverageOff | ||
> test | ||
# There should be no scoverage-data directory | ||
-$ exists target/scala-2.12/scoverage-data | ||
-$ exists target/scala-2.13/scoverage-data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing typo, Making test work (again). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "3.2.0-RC1" | ||
|
||
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test | ||
|
||
coverageExcludedFiles := ".*\\/two\\/GoodCoverage" | ||
|
||
resolvers ++= { | ||
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT"))) | ||
Seq(Resolver.sonatypeRepo("snapshots")) | ||
else Seq.empty | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.6.2 |
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 | ||
} |
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 | ||
} | ||
|
||
} |
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 | ||
} | ||
|
||
} |
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) | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.2.0-RC1/scoverage-report/two | ||
# But right now there is, because Scala3 does not support excluding files | ||
$ exists target/scala-3.2.0-RC1/scoverage-report/two | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to show/document that excluding files (and packages) is not working right now. Aiming to make this work (somehow). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a test for
excludedFiles
.