Skip to content

Commit 813a6c1

Browse files
committed
proper test coverageAggregate
1 parent 25f769f commit 813a6c1

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

Diff for: src/sbt-test/scoverage/aggregate/build.sbt

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/*
22
The projects test aggregation of coverage reports from two sub-projects.
3-
The sub-projects are in the irectories partA and partB.
4-
The tests are against the sources of ScoverageSbtPlugin in the parent directory.
5-
It might be possible to test other versions of ScoverageSbtPlugin.
3+
The sub-projects are in the directories partA and partB.
64
*/
75

86
lazy val commonSettings = Seq(
@@ -35,6 +33,3 @@ lazy val root = (project in file("."))
3533
partA,
3634
partB
3735
)
38-
39-
40-

Diff for: src/sbt-test/scoverage/aggregate/project/plugins.sbt

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
/*
2-
* ScoveragePlugin is constructed from the sources in the parent directory
3-
*/
4-
lazy val root = (project in file(".")).dependsOn(scoveragePlugin)
1+
// The Typesafe repository
2+
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
3+
4+
//scoverage needs this
5+
resolvers += Classpaths.sbtPluginReleases
6+
7+
{
8+
val pluginVersion = System.getProperty("plugin.version")
9+
if(pluginVersion == null)
10+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
11+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
12+
else addSbtPlugin("org.scoverage" %% "sbt-scoverage" % pluginVersion)
13+
}
14+
515

6-
lazy val scoveragePlugin = file("../../../..").getAbsoluteFile.toURI

Diff for: src/sbt-test/scoverage/aggregate/test

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
#this file is necessary for scripted plugin. See http://eed3si9n.com/testing-sbt-plugins
2-
#it is empty for now
1+
# run scoverage using the coverage task
2+
> clean
3+
> coverage
4+
> test
5+
# There should be scoverage-data directory
6+
$ exists partA/target/scala-2.10/scoverage-data
7+
$ exists partB/target/scala-2.10/scoverage-data
8+
> coverageAggregate
9+
# There should be scoverage-data directory
10+
$ exists target/scala-2.10/scoverage-report

Diff for: version.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "1.3.3"
1+
version in ThisBuild := "1.3.4"

0 commit comments

Comments
 (0)