Skip to content
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

coverage.data in wrong place #67

Open
fxkr opened this issue Sep 6, 2013 · 0 comments
Open

coverage.data in wrong place #67

fxkr opened this issue Sep 6, 2013 · 0 comments

Comments

@fxkr
Copy link

fxkr commented Sep 6, 2013

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")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant