Hi Martin,
this is not supported out of the box by JaCoCo. But we have the building blocks to create something like this.
* You need to hook into your test frameworks to tell test cases apart
* Between each test case you need to trigger a exec file dump (or receive data via TCP) and reset probes
No the hard parts start which I have no idea how this scales for large projects: For every test case (exec file) you create a coverage report. This can be in-memory only, no need to write HTML or XML to disk for this. From this you would need to create a gigantic matrix between your code base and the test cases. Maybe you can aggregate both a bit to keep the matrix in a reasonable size (e.g. only in Java module or package level).
Regards,
-marc
Beside your scenario may I add my personal view on this: Code coverage should only be applied in white box testing (i.e. Unit Testing). This means there is a simple 1:1 mapping between test cases and code. Maybe not on method or class level, but at least on package or module level. That’s why I recommend to only count coverage within the module. Implicit coverage by using other modules must not be counted for white box test coverage.