FAQ Database Discussion Community


Exporting coverage data from build machine

teamcity,code-coverage
I was working on team internal KPI's lately and I thought that code coverage/number of unit tests will be a great measure. In our CI build pipeline we're using NUnit to run test and JetBrains dotCover to generate coverage report - everything works great and we have that fancy "statistics"...

Filter JaCoCo coverage reports with Gradle

java,unit-testing,gradle,code-coverage,jacoco
Problem: I have a project with jacoco and I want to be able to filter certain classes and/or packages. Related Documentation: I have read the following documentation: Official jacoco site: http://www.eclemma.org/jacoco/index.html Official jacoco docs for gradle: https://gradle.org/docs/current/userguide/jacoco_plugin.html Official jacoco Github issues, working on coverage: https://github.com/jacoco/jacoco/wiki/FilteringOptions https://github.com/jacoco/jacoco/issues/14 Related StackOverflow Links: JaCoCo...

Running coverage.py over unit tests with mocking

python,python-3.x,code-coverage
I'm trying to run code coverage over my program's unit tests. I'm using mock in the tests, which means I have to use python3 and up. I've installed coverage.py using pip: pip install coverage The installation worked and coverage is working preperly. The issue is that when I'm trying to...

Using Istanbul and Mocha to cover ES6 code

node.js,code-coverage,mocha,ecmascript-6,istanbul
I have Node code, written in ES6, that I test by issuing mocha --harmony. Tests are fine - everything works. Now I want to add coverage and istanbul to the mix, but I keep getting errors on the first arrow function encountered: No coverage information was collected, exit without writing...

jacoco showing code coverage is 0

java,maven,code-coverage,jacoco
I have below pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18</version> <configuration> <!-- Sets the VM argument line used when unit tests are run. --> <argLine>-Xms512m -Xmx1024m -XX:MaxPermSize=512m ${jacoco.agent.argLine}</argLine> </configuration> </plugin> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId>...

Selenium test coverage for .net (C# and VB)

c#,.net,vb.net,selenium,code-coverage
What I'm looking for is a way to show me code coverage from my Selenium tests. At this point in time, I'm not sure if this is possible since the tests just load up an instance of a browser. From the research I have done, it seems like all the...

Send existing LCOV file to SonarQube

javascript,testing,sonarqube,code-coverage
Because of the way my project is built, I can't use SonarQube to run coverage on my project. I have my JavaScript coverage all working with Karma and other tools. These tools output a valid LCOV file. Everything else I've found requires you to have SonarQube run the coverage and...

Code Coverage for Android Library Project while using Robolectric

android,ant,code-coverage,robolectric,eclemma
I have an android library project. We are using Robolectric to run the unit tests. Unit Tests are working fine from the IDE as well as Ant build.xml file. I am able to get the code coverage using the eclEmma plugin in Eclipse. But I am facing problems while getting...

How do I generate coverage reports for fork()'d children using gcov/lcov?

c,fork,code-coverage,gcov,lcov
I'm having trouble generating coverage reports for a project of mine -- it seems that the lines in the child process after a fork are never hit, althought they clearly are in reality. Here is the coveralls report of the forking part (The results are the same with lcov+genhtml), and...

increasing code coverage for JdbcTemplate mocking

spring,unit-testing,mockito,code-coverage,jacoco
I am mocking JdbcTemplate for unit test cases, as don't want to hit actual database integration. But it is decreasing my code coverage (Red indicates missing coverage). Below is the snippet used. Same case happens by using user defined mappers. final List<String> resultList = new ArrayList<String>(); resultList.add("test1"); resultList.add("test2"); final JdbcTemplate...

How to execute Unit Test with Sonar Qube 5.0.1

unit-testing,sonarqube,code-coverage,gallio,opencover
I was able to execute Unit test with lower version of Sonarqube but then i upgraded to SonarQube 5.0.1. Then suddenly my Gallio was not working. I found in some blocks that support for gallio was not available in sonarqube 5.0.1 Is there any other way to run unit test...

How can I insert tcov to Make File

code-coverage,solaris
How can i use tcov on Solaris in make file? My make file makes .o files and then the .so files which is copying to the lib's folder. I work with Oracle BRM CFLAGS_solaris= -g -xcg92 -xprofile=tcov C++FLAGS_solaris= -g -library=%none -DPIN_NOT_USING_OSTREAM CPPFLAGS = -I$(INCDIR) -I$(INCDIR_MDS) -DPCMCPP_CONST_SAFE LDFLAGS_solaris= -G SL_EXT_solaris= so...

Sonarqube does not retrieve my JavaScript coverage from LCOV

javascript,sonarqube,code-coverage,lcov,karma-coverage
I have an application with the following structure: my-application +- pom.xml +- app | +- scripts | | +- app.js | | +- **/*.js | +- 3rd-party-libs +- build +- node_modules +- test I've create the pom.xml only to run the SonarQube analysis. Otherwise, all the tasks are run by...

Getting Karma, 6to5ify and Istanbul to play ball

code-coverage,karma-runner,browserify,ecmascript-6,karma-coverage
I have Browserify, 6to5ify and Karma to play nice, successfully running my specs. When I add code coverage however, things go south. I've tried several approaches: Add browserify-istanbul transform to my karma.conf.js. However, this results in it trying to run instrumentation on my spec-files as well it would appear. Run...

How to find which branches are not covered by tests?

python,python-3.x,code-coverage,coverage.py
I am measuring code coverage of a small Python application. Although line coverage is 100%, branch coverage is not. The problem is that coverage won't give me any indication about the location of branches not being covered. coverage run --branch --omit=/usr/lib/python3/dist-packages/*,tests/* -m unittest discover returns: Ran 33 tests in 0.079s...

turning off coverage in nosetests

python,code-coverage,nose
How do I conditionally turn off coverage when running nosetests? there is a --with-coverage flag that doesn't seem to do all that much. It certainly does not turn off coverage. Mind you, I like coverage and I want to keep it. I just find it extremely distracting to see its...

JaCoCo report fails in Jenkins: java.lang.ArrayIndexOutOfBoundsException

java,jenkins,code-coverage,jacoco,emma
I have been using JaCoCo locally with no problem. When running a Jenkins job on a remote server, the job builds fine and generates JaCoCo coverage report (i.e. it appears in my workspace/report folder) but the build fails when attempting to publish the report on Jenkins. I am using Jenkins...

Does coveralls provide views coverage for rails?

ruby-on-rails,code-coverage,coveralls
I can't find any documentation on what coveralls provides coverage reports for in Rails, and I need something for views coverage. Does coveralls provide views coverage?

Strange behavior of ECLEmma Code Coverage Tool in eclipse

java,eclipse,junit,code-coverage,eclemma
there is a strange problem with the code coverage tool ECLEmma: For the class MyFirstLogger I wrote the testclass MyFirstLoggerTest: Please notice that I wrote in MyFirstLoggerTest a Testmethod where I expect to get a NullPointerException, just for the purpose to go through the else if-case in the setLogger-method in...

How to increase the coverage on testing angular directive?

angularjs,code-coverage,karma-runner,istanbul
So here is my angular directive. Simple one that uses a template url angular.module('my.directives') .directive('userNameDisplay', function() { return { restrict: 'E', scope: { user: '=user', status: '=status' }, templateUrl: '/partials/userNameDisplay.html' }; }); The spec is as follows. Again it tries to cover all cases. describe('user-name-display', function () { var elm,...

CodeCoverage of C++ libraries doesn't highlight all lines

c++,code-coverage
I have a C++ library which I'm instrumenting using vsinstr.exe and then running vsperfmon.exe. When I open the .coverage file in Visual Studio I am seeing some lines which are not highlighted in any color, and I know for sure that these lines were hit. What could be the reason...

Alternatives for for loops in R?

r,code-coverage,bioinformatics
I got 2 files which I'd like to combine using R. head(bed) chr8 41513235 41513282 ANK1.Exon1 chr8 41518973 41519092 ANK1.Exon2 The first one is giving intervals and their names. (Chromosome, from, to, name) head(coverage) chr1 41513235 20 chr1 41513236 19 chr1 41513237 19 The second one is giving coverages for...

Generating Define-Use Paths for C Code coverage analysis

c,code-coverage
How is it possible to generate uncovered Define-Use Paths for C Code (using e.g. gcc). As I saw this subject is only academic. (unlike line coverage) resource: http://whiteboxtest.com/Data-Flow-Testing.php...

Using Visual Studio to do Code Coverage on gtest unit tests for native VS C++

c++,unit-testing,code-coverage,googletest
Friends, I have been looking at unit test code coverage tools for the last 2 weeks, evaluating them for our specific needs. The last one I would like to evaluate is Visual Studio's own code coverage for native C++ unit tests. In our solution, we have the following: full Visual...

Roslyn - dynamic (runtime) flow

c#,code-coverage,roslyn
I started playing with Roslyn. It’s relatively easy to parse code and do static analysis. I wonder if it’s possible to use it for runtime analysis? I want to call a method with parameters and check which branches were executed. In other words, I need a runtime execution plan. Is...

Viewing condition coverage in intellij

unit-testing,intellij-idea,junit,code-coverage,jacoco
Given the code: public void foo(int age,boolean smart) { if (age>18 && smart) { // <--- This is the part that should be covered doSomething() } } Using JUnit I test foo(15,true) and foo(25,true) IntelliJ will report that the condition line was fully covered (green), but it was not. In...

How to setup perl to always run code coverage

perl,code-coverage
I'd like to setup my project to always run the scripts through perl's Devel::Cover module. I've tried replacing the perl binary with something like this #!/bin/sh exec /usr/local/bin/original-perl -MDevel::Cover [email protected] with no success. I'd like to avoid modifying the #! for every script on my system (not the end of...

Visual studio does not exist in the namespace, but reference is added

c#,visual-studio-2012,reference,code-coverage
I am building a custom code coverage app using the Microsoft.VisualStudio.Coverage.Analysis class. I have added the reference to the dll to my solution already and when I start typing the using statement at the top of my class Visual Studio is predicting the correct names, e.g. after typing "Microsoft." "VisualStudio"...

Code / Test coverage tool for cocoapods?

ios,code-coverage,cocoapods,test-coverage
Is there a tool out there that can check the coverage of a cocoapod repository? I've taken a look at codeclimate, gcov, gcovr, XcodeCoverage, cocoapods-coverage, but none of them will check the coverage of the cocoapod files, just the default project's classes....

Showing Cobertura results in Netbeans for non Java project

netbeans,code-coverage,cobertura
I recently started working with NodeJS applications using Netbeans IDE. I have simple project that I'm testing with Intern testing framework. Basically it allows for writing unit and functional tests but also allows to generate code coverage reports. Those reports can be in the following formats: cobertura - This reporter...

How does Visual Studio measure the % Blocks coveraged in test unit?

visual-studio,unit-testing,teamcity,code-coverage
When I click to run the unit tests with code coverage, it has a column showing the % of blocks coveraged. I also use TeamCity to measure, and I noticed that they have different metric. I would like to know how Visual Studio measures. I did some calculations but I...