Question

Are there any tricks that I need to use to get Line Level coverage reports working w/ Scala code using Emma? I can get it working w/ Java code fine, but for some reason the debug info is not getting into the class files when I use scalac.

Any help would be appreciated.

Was it helpful?

Solution

I don't think it would be practical using Emma for Scala code coverage:
As mentioned in "Partial EMMA code coverage in Scala Case Class for IntelliJ IDEA 10.5", as an example of the issue you would face is most of the method generated in the bytecode would be reported at the same line number as the class definition.

The answer "Code Coverage Tools for Scala" mentions scct as the Code Coverage tool of choice for Scala. (source code on gitHub).

scct

Considering it ("theoretically") supports now scala 2.9.+, you could use it first, and see if it works better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top