Aggregate jmockit-coverage output with emma coverage output - ant

Is there a way to aggregate code coverage data from jmockit-coverage and emma coverage? I can run the two different coverage steps in two separate junit ant tasks and generate the coverage data in two directories. Just not sure if the coverage outputs from these two are compatible and can be merged to display together.

No, they can't be aggregated into a single HTML report, since these are two different code coverage tools, which know nothing about each other. Of course, someone could create yet another tool which would do that; personally, I don't see much value in it, though.

Related

Is it possible to show trends from an lcov report in jenkins?

I have an lcov report which produces a pretty html report and an lcov.info file. I want to see on jenkins whether our code coverage is improving or degrading. Is it possible to do this with an lcov report? I can do it using cobertura, but for various reasons we need to stick with lcov. We also need to see statements, branches, functions and lines.
The coverage report is being produced by istanbul/nyc.

Need to get only Unit Test Coverage results using SONAR

Is there any way I could JUST get the unit test code coverage results on SONAR. My project is to just focus on the code coverage and not on code issues/violations/rules etc.
It would be a big time saver for me. As the project that I am dealing with has million lines of code. I have all my jacoco.exec files generated and appended. Sonar analyses in and out of our code and which takes hours. code standards,rules,violations,issues for which my project is not concerned off.
Any help on this would be highly appreciative.
Regards
Eajaz
This is really an edge case for the use of SonarQube.
If you use an empty quality profile for analysis, you should not get any issue on your code, only metrics - including coverage, which seems your main concern.

Using gcovr to show zero coverage

we try to use gcovr to generate coverage report for our c++ project in Jenkins.
I was able to get it worked, but I'm stuck with one problem. gcovr doesn't show any statistics for files with zero coverage - they have only .gcno files, no .gcda files are produced and gcovr don't show it in results.
So I have 80% coverage for the whole project, but only 2 tests were written and it's actually 80% coverage only for source files involved in tests.
For large project it makes of course no sense to use such statistic.
I have found https://software.sandia.gov/trac/fast/changeset/2766 this changeset as solution for this ticket https://software.sandia.gov/trac/fast/ticket/3887, but it seems not to be working.
Did I miss something?
p.s. I use gcovr 3.1-prerelease

Combine cobertura code coverage reports of three separate projects

I have three projects which are stored in three separate repositories. Each of them is a individual mvn project. I wonder is there a way to aggregate three reports in one?
I took a look at the cobertura aggregate function. But seems like it can only handle sub-modules of a project.
Anybody has any suggestion?
The Maven plugin goal cobertura:cobertura supports an aggregate parameter that would work for all the projects in the reactor I suppose.
But you seem to suggest the projects might not be in the same structure/reactor, and i wouldn't know how to do it with maven per-se. However, you can easily do it with a little ant script that can be integrated in your maven structure.
The Cobertura Ant library has a merge task that can merge a number of .ser files (generated by the runtime execution of your instrumented code). This will generate a combined .ser file for which you can generate a xml or html report from.
Let me know if you need more pointers.
In another question a responder gave a link to a python script they had written that did what you are asking, I moved that "xml combiner" to a gist that is located here

myBatis code coverage tool

I am going to write code coverage tool for myBatis SQL maps.
Basically, I want to know if each statement has been called during "mvn test". The second step is to compare executed and existing statements and print difference somehow.
I wonder if it already exist because I didn't find?
For those who are interested in. Finally I've implemented this feature.
Just a few facts. I've created framework based on spring-test and junit. The main goal was to test myBatis statements on multiple databases at the same time.
Coverage tool is just a feature to help developer define missing tests.
The way how coverage tool is working could be explained as following steps:
get all statement names from myBatis once using getMappedStatementNames() method from SqlMapExecutorDelegate class.
collect all statement names that was called.
print difference between all and executed to the log.
There are many other improvements to this small test framework. And then all this stuff integrated into automated build system, integrated with Bamboo server etc.
At the end I've got output like this:
WARN 18/04/2012 15:14:50 (MultipleDatabaseRunner.java:108) COVERAGE: Statement Audit.getAudit wasn't tested.
...

Resources