Skip to content

Commit 6f9fd4a

Browse files
committed
Execute scripted tests on Travis
1 parent 04716e2 commit 6f9fd4a

File tree

14 files changed

+111
-45
lines changed

14 files changed

+111
-45
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: scala
22

3-
script: sbt ++$TRAVIS_SCALA_VERSION test
3+
script: sbt ++$TRAVIS_SCALA_VERSION scripted
44

55
after_script:
66
- if [[ $TRAVIS_TEST_RESULT == 0 &&

src/sbt-test/scoverage/aggregate/build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ lazy val root = (project in file("."))
3333
partA,
3434
partB
3535
)
36+
37+
resolvers in ThisBuild ++= {
38+
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots"))
39+
else Seq.empty
40+
}

src/sbt-test/scoverage/aggregate/project/plugins.sbt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/release
44
//scoverage needs this
55
resolvers += Classpaths.sbtPluginReleases
66

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-
}
7+
val pluginVersion = sys.props.getOrElse(
8+
"plugin.version",
9+
throw new RuntimeException(
10+
"""|The system property 'plugin.version' is not defined.
11+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin))
1412

13+
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % pluginVersion)
1514

15+
resolvers ++= {
16+
if (pluginVersion.endsWith("-SNAPSHOT"))
17+
Seq(Resolver.sonatypeRepo("snapshots"))
18+
else
19+
Seq.empty
20+
}

src/sbt-test/scoverage/aggregate/test

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# There should be scoverage-data directory
66
$ exists partA/target/scala-2.10/scoverage-data
77
$ exists partB/target/scala-2.10/scoverage-data
8+
> coverageReport
9+
# There should be scoverage-report directory
10+
$ exists partA/target/scala-2.10/scoverage-report
11+
$ exists partB/target/scala-2.10/scoverage-report
812
> coverageAggregate
9-
# There should be scoverage-data directory
10-
$ exists target/scala-2.10/scoverage-report
13+
# There should be a root scoverage-report directory
14+
$ exists target/scala-2.10/scoverage-report

src/sbt-test/scoverage/bad-coverage/build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test"
77
coverageMinimum := 80
88

99
coverageFailOnMinimum := true
10+
11+
resolvers ++= {
12+
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots"))
13+
else Seq.empty
14+
}

src/sbt-test/scoverage/bad-coverage/project/plugins.sbt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/release
44
//scoverage needs this
55
resolvers += Classpaths.sbtPluginReleases
66

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-
}
7+
val pluginVersion = sys.props.getOrElse(
8+
"plugin.version",
9+
throw new RuntimeException(
10+
"""|The system property 'plugin.version' is not defined.
11+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin))
1412

13+
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % pluginVersion)
1514

15+
resolvers ++= {
16+
if (pluginVersion.endsWith("-SNAPSHOT"))
17+
Seq(Resolver.sonatypeRepo("snapshots"))
18+
else
19+
Seq.empty
20+
}

src/sbt-test/scoverage/coverage-off/build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test"
77
coverageMinimum := 80
88

99
coverageFailOnMinimum := true
10+
11+
resolvers ++= {
12+
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots"))
13+
else Seq.empty
14+
}

src/sbt-test/scoverage/coverage-off/project/plugins.sbt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/release
44
//scoverage needs this
55
resolvers += Classpaths.sbtPluginReleases
66

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-
}
7+
val pluginVersion = sys.props.getOrElse(
8+
"plugin.version",
9+
throw new RuntimeException(
10+
"""|The system property 'plugin.version' is not defined.
11+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin))
1412

13+
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % pluginVersion)
1514

15+
resolvers ++= {
16+
if (pluginVersion.endsWith("-SNAPSHOT"))
17+
Seq(Resolver.sonatypeRepo("snapshots"))
18+
else
19+
Seq.empty
20+
}

src/sbt-test/scoverage/good-coverage/build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test"
77
coverageMinimum := 80
88

99
coverageFailOnMinimum := true
10+
11+
resolvers ++= {
12+
if (sys.props.get("plugin.version").map(_.endsWith("-SNAPSHOT")).getOrElse(false)) Seq(Resolver.sonatypeRepo("snapshots"))
13+
else Seq.empty
14+
}

src/sbt-test/scoverage/good-coverage/project/plugins.sbt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/release
44
//scoverage needs this
55
resolvers += Classpaths.sbtPluginReleases
66

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-
}
7+
val pluginVersion = sys.props.getOrElse(
8+
"plugin.version",
9+
throw new RuntimeException(
10+
"""|The system property 'plugin.version' is not defined.
11+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin))
1412

13+
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % pluginVersion)
1514

15+
resolvers ++= {
16+
if (pluginVersion.endsWith("-SNAPSHOT"))
17+
Seq(Resolver.sonatypeRepo("snapshots"))
18+
else
19+
Seq.empty
20+
}

0 commit comments

Comments
 (0)