mtkopone / scct

Scala Code Coverage Tool
http://mtkopone.github.com/scct/
Apache License 2.0
129 stars 39 forks source link

maven multi-project compilation fails after updates made on october 4 #28

Closed firepub-pfreeman closed 11 years ago

firepub-pfreeman commented 11 years ago

after the commits on october 4th, my project will no longer build at the top level from maven. The build fails when coverage is being recorded in a sub-module that is exercising classes from another module that has been built with scct. In other words, I have a maven project with two modules, A and B. B depends on A. I run a maven build for the entire project, first A builds, then B builds. A's coverage reporting works fine. B's coverage reporting fails when B is using a class in A. It appears to be trying to track coverage in A while exercising B, which would be fine but the indexing into the counters array is now off. Prior to October 4th, the multi-project build worked fine.

java.lang.ArrayIndexOutOfBoundsException: 1202 at reaktor.scct.Coverage$.invoked(Coverage.scala:25)

mtkopone commented 11 years ago

D'oh.

Turns out I had forgotten that maven multi-project builds use instrumented classes for dependent projects. So basically using A from B messed up B's reporting. The previous performance fixes brought this issue to light.

Commit https://github.com/mtkopone/scct/commit/4dcea5849c9c1119fc29fdb1a1e625edd449cc00 should fix this.

Thanks for the report!