tags:

views:

62

answers:

1

If I instrument two jars in emma, point them to the same emma session file, and then run them concurrently (e.g., a client and a server), should I expect things to work or fail miserably? The jars are building out of common source, so I don't expect problems with the metadata.

I didn't see anything about this in documentation, so if it is there a pointer would certainly be welcomed.

+1  A: 

No it can't. Emma writes out the result of instrumentation when the process ends for the most part. It overwrites any file in the existing position, but it is also writing out a text file and has no direct support for merging as it goes along or of merging multiple reports.

There is however a profiling tool that might help you do this called Grobo. It has a profiling mode "safe" which writes every event to the logging file and then closes that log file. That may allow multiple instances to run and output to the same place and give you up to date profiling information without shutting down the process. An older version used to allow the merging of coverage reports but the latest version makes no mention of it. I have used it in the past where Tomcat was killing the Emma profiling thread before it finished writing out, and in that scenario the safe mode worked to ensure all coverage data was written without problems. It can also be used to get coverage part way through a set of tests which with integration tests can sometimes be very useful.

The other option, and likely the best one, is Cobertura. It has the ability to merge multiple report files and hence you could run each of your Java processes with a different output file and then merge them all at the end to produce your report of combined coverage.

Paul Keeble