I made some changes on my source code (let's say I changed/added 10 lines) and want to check the coverage for only these 10 lines. Is there any feature in gcov that can help me on this and get the coverage of only these 10 lines.
Related
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.
Scenario
I am running jest (or a React project) to test my files.
Goal
I would like to see the coverage report for all my source files and then by running jest in --watch mode see only the changed files report change (hopefully improve) while leaving the untested files report untouched.
Problem
Right now, while running jest --config=config/jest/config.json --watch --coverage, and using the configuration "collectCoverageFrom": ["src/**/*.{tsx,ts}"] the coverage related with the modified file are updated properly BUT the coverage for the UNTESTED files goes back to 0% (since no test where run for those files and any previous test run got forgotten)
Question
Is there a way to retain the old tests coverage reports for the untested files?
Why?
Imagine us having 100 files in the src folder. At the beginning all the coverage is 0%. Then you start jest in watch mode and you fix 1 file. The coverage shows 100% for that file, 0% for the other files. Total coverage of 1%.
Then you change a second file (the day after). Your total coverage should be 2%, instead since TODAY you changed only 1 file, the overall coverage is reported as 1%.
The correct total coverage is reported only when you run a full test+report without using the watch mode, but this makes the process non-practical since I would like to fix progressively my tests, watch for file changes and see the coverage grow as I fix.
Similar reported issues
https://github.com/facebook/jest/issues/2256 it was closed by I still don't understand how it would fix the problem
Ideas
I don't mind if to have this report I need to adapt jest/istanbul to do some magic merge of reports. I tried to follow some comments on github but couldn't come up with something that works
Never thought about it before but is there an easy way to count all lines of code in a project? You can see how many lines of code there are in a single form but if you have hundreds its not an easy task.
Does RAD Studio have a feature to count the number of lines in your project?
Yes, there is a simple way. You can just build a project and you'll see total number of compiled lines. It's funny sometimes... say, when I built a release with exactly 666'666 total.
Make sure that 'Automatically close on successful compile' is unchecked otherwise the compile window may disappear too quickly. Or look under Project/Info right after the build.
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.
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