scct
scct copied to clipboard
coverage.data in wrong place
Hi,
I'm using Scala 2.10.2, SBT 0.13.0 and sbt-scct 0.2-SNAPSHOT.
scct:test puts the coverage.data file into the project root directory, but doesn't read it back from there again:
java.lang.NullPointerException
at reaktor.scct.Env$$anonfun$coverageFile$2.apply(Env.scala:53)
at reaktor.scct.Env$$anonfun$coverageFile$2.apply(Env.scala:53)
at scala.Option.getOrElse(Option.scala:120)
at reaktor.scct.Env.coverageFile(Env.scala:53)
...
When I move coverage.data to target/scala-2.10/scct-classes/ and rerun scct:test it picks up the file and finishes generating the output correctly.
From Env.scala:
def coverageFile = Env.sysOption("scct.coverage.file")
.map(new File(_)).getOrElse(
new File(getClass.getResource("/coverage.data").toURI))
You should propably try File("coverage.data") before File(getClass.getResource("/coverage.data").toURI)).
One can work around it by setting scct.coverage.file, e.g. in build.sbt:
initialize ~= { _ =>
System.setProperty("scct.coverage.file", "coverage.data")
}