Generating code coverage report using theIntern - code-coverage

I am using theIntern for unit testing my javascript framework. My test is running fine using node.
However, I am not able to generate code coverage report properly. I tried the options provided in the documentation. I was successful to print code coverage information on to the console while testing through selenium web driver. That gives only a summary.
How can I generate extensive code coverage report using reporters other than console?
I provided the "reporters" option but doesn't print the report. Any help would be appreciated.

The lcov reporter generates an lcov.info file that can then be passed to the lcov genhtml utility to output a complete set of HTML coverage reports (the simplest invocation is just genhtml lcov.info).
In Intern 1.2, however, there is a bug with the generated lcov.info files (fixed for Intern 1.3) that may cause genhtml to fail to find any coverage data inside a generated lcov.info file. The patch for this issue is very simple and you should be able to cleanly it to Intern 1.2 until the new version is released in the next couple of weeks.

Related

Getting the decision coverage HTML report with gcovr

I am using gcovr to generate the coverage analysis of some unit tests, and wanted to generate the HTML decision coverage report.
I am using Matlab, and am calling gcov and gcovr and generating the report following the instructions in the gcov 5.1 user's manual:
[status,report] = system([path_to_my_function,' & gcovr --gcov-executable gcov --decisions --html-details -o',name_of_my_html_report])
However, I am getting all the time an error saying that --decisions command is not defined for gcov. I have been trying different locations for the command, but didn't work, and looking on the Internet, but didn't find anything.
Does anybody have an idea of the possible error I may be doing?
Thank you!

Generating an in-memory coverage report using Clang Source-based Code Coverage

I followed The Clang manual and used __llvm_profile_write_buffer to collect coverage cprofile data inside the instrumented program.
This works well, but to actually generate a coverage report the recommended way is to use the llvm-cov tool like this:
llvm-cov show ./foo -instr-profile=foo.profdata
This tool needs access to the binary which does not play well with __llvm_profile_write_buffer .
Is there a way to generate a coverage report similar to what llvm-cov does, but inside the process, from the buffer updated by __llvm_profile_write_buffer ?
I guess this would involve accessing the symbol table from within the process, which I think is doable?
Use case : I would like to upload the coverage report from within the process to a remote server without having to execute an external tool.
Thanks for your help,
Antoine

Code coverage of Polymer Application with WCT

I have the sapplication developed in Polymer and unit testing with WCT. I want to generate the code coverage report for that.
I tried with the istanbul(web-component-tester-istanbul), but it is not supporting it, I am using Polymer Version 1.2.
And I tried with Karma + Grunt, but I am not able to genrate the code coverage report.
Can anybody tell me how we can generate code coverage with Karma? I search on google but not able to find WCT with Karma.
You can use the modified version for now till the original Istanbul is fixed to work with Polymer. wct-Istanbub

How to get code coverage in Xcode 6?

My tests are XCTests and I'm using Objective-C instead of Swift.
I've seen some articles that tackle the topic, but the seem focused on older versions of Xcode, for example:
Visualizing Code Coverage with Xcode
Code Coverage Fixed for Xcode 5.1
What would be the recommended approach to get code coverage on Xcode 6? Does Apple have something built in for code coverage, maybe via Xcode CI via OSX Server?
Take a look at frankencover.it
Simple script that can be run from dev's cmd-line or CI build server.
Produces console output as well as a detailed report in HTML format. This can be viewed locally or published as an artifact by the build server.
Optionally includes a checker that will 'fail' the build if required coverage is not met. (Feedback only. This is a prompt to review coverage and look for useful tests that can be added or reduce the required amount. Either option may be correct. )
Free for both commercial and open-source projects. No hosting, sponsorship or subscription required.
Usage:
FTW, it has an easy-to-remember dogue-speak-esque command line interface:
groovy http://appsquickly.github.io/frankencover.it/with --source-dir MyProject/Source
Terminal Output:
HTML Report:
We use Xcoverage for this..Check on link below, if this helps..
Xcoverage
This is an update, From Xcode 6 Apple having in-build code coverage tool, But Have a look at coverStory it is easy to configure test locally before push.
And providing a line by line coverage.

how to see line coverage in Bullseye

Recently I started using BullseyeCoverage.
I'm going through the steps: compiling with BullseyeCoverage, running some test cases on the binaries created, generating a coverage report.
In the coverage report there are: function coverage, and condition/decision coverage. However, there is no line coverage. I tried to find a way of generating line coverage statistics, unsuccessfully. I thought of using covbr to this end, but, I need something that will cover all of my sources altogether.
Thanks for your help!
Bullseye does not support line coverage (which is also called statement coverage).For reasons, see http://www.bullseye.com/statementCoverage.html

Resources