tinsweep/have-no-bananas — pull request #10 by niffer01 (2014-07-18 04:48:31+00:00)
Title: Added Emma.

I've added Emma to the project, but it fails to create the coverage report. Everything else still works, however.

Here's the issue I'm having: The JVM isn't creating the file coverage.ec as it is running the tests. Without this file Emma cannot generate the coverage report. It looks like the coverage.out.file property isn't getting set even though I'm setting it in the script - that is the property that tells the JVM the name of the file. It has to use an absolute path, which it is using, to prevent the JVM from dumping the file wherever. But I even did a search for the file on my entire hard drive and still no luck.

I did a lot of Googling on this and didn't find anything to fix the problem, but I did find notes that Emma doesn't work with Java 7 and beyond. I am using Java 8, so I think getting a coverage report on my computer is a lost cause. However, you guys might have better luck so that is why I am making the pull request. As I said, this won't break anything, it just isn't doing what we want it to do, namely create the coverage report.

Emma Overview:

The lib directory has two new files, emma.jar and emma_ant.jar. This is all you need installed for you to use Emma. The build.xml file has been adjusted so that every time you run ant it will kick off Emma. (You can write it so you can run Emma or not, but for simplicity's sake I have it running Emma all the time.) The script will create an emma directory which will have the coverage reports and Emma data files. The script also creates emmainstr under the build directory. This will have the compiled code. It's copied from the build\classes directory. I had to set Emma to copy all of the files to include the interfaces (mode="fullcopy"). Without that setting Emma would copy only the active classes, and things failed without the interfaces.

The Emma directories look like this:

have-no-bananas
build
classes
emmainstr
report
emma

lib
emma.jar
emma_ant.jar

Tomorrow (Friday) I will start working with Cobertura, although I also saw similar comments on the web about that being unstable with the new Java version. A few people recommended JaCoCo, which was written by former Emma for Eclipse developers, so I may resort to that. I'm hoping, however, that Emma will work for you guys and I'm just the oddball.