code-coverage

Why don't I get code coverage results for C++/CLI project in Visual Studio 2010?

非 Y 不嫁゛ 提交于 2020-01-06 16:22:06
问题 I've recently upgrade my solution to Visual Studio 2010. I have 4 projects I want to cover using unit tests - 3 C# and 1 C++/CLI. I get coverage for the C# projects but not for the C++/CLI project. I did get for all of them in Visual Studio 2008. I've configured the assemblies using testrunconfig -> Data and Diagnostics -> Code Coverage -> Configure. Why don't I get code coverage result for the C++/CLI project? 回答1: I've found out what was wrong. It appears that the upgrade from Visual Studio

Why don't I get code coverage results for C++/CLI project in Visual Studio 2010?

馋奶兔 提交于 2020-01-06 16:22:02
问题 I've recently upgrade my solution to Visual Studio 2010. I have 4 projects I want to cover using unit tests - 3 C# and 1 C++/CLI. I get coverage for the C# projects but not for the C++/CLI project. I did get for all of them in Visual Studio 2008. I've configured the assemblies using testrunconfig -> Data and Diagnostics -> Code Coverage -> Configure. Why don't I get code coverage result for the C++/CLI project? 回答1: I've found out what was wrong. It appears that the upgrade from Visual Studio

sonar with gallio and opencover, code coverage: 0%

試著忘記壹切 提交于 2020-01-06 06:47:20
问题 I'm using sonar to check my c# project. I would like to measure code coverage that's why i installed gallio and opencover. When I run soner-runner everything works fine, my unit test is performed, ... but the code coverage is 0% on the sonar web UI. do you know the reason why the code coverage is 0%? My solution, project and classes: (S) SonarTestSolution (P) ClassLibrary1 (C) Class1.cs (P) ClassLibrary1NUnitTest (C) Class1NUnitTest.cs content of Class1.cs: public class Class1 { public String

How to exclude code (packages) in jococo, eclemma

会有一股神秘感。 提交于 2020-01-06 06:44:49
问题 I am trying to exclude code in jococo. I have given for the package that I want to exclude and vice versa tags in my code for the package that I want to include. but still ECLEMMA while junit coverage is reading whole code i.e. all packages and hence my code coverage goes down. Here is my code: <includes> <include>com.cfgh.controller.*</include> <include>com.cfgh.service.*</include> <include>com.cfgh.repository.*</include> </includes> <excludes> <exclude>com.cfgh.config.*</exclude> <exclude

How to exclude code (packages) in jococo, eclemma

蹲街弑〆低调 提交于 2020-01-06 06:44:04
问题 I am trying to exclude code in jococo. I have given for the package that I want to exclude and vice versa tags in my code for the package that I want to include. but still ECLEMMA while junit coverage is reading whole code i.e. all packages and hence my code coverage goes down. Here is my code: <includes> <include>com.cfgh.controller.*</include> <include>com.cfgh.service.*</include> <include>com.cfgh.repository.*</include> </includes> <excludes> <exclude>com.cfgh.config.*</exclude> <exclude

PhpUnit + Symfony: Why coverage shows white instead of red and gives 100% on untested class?

こ雲淡風輕ζ 提交于 2020-01-06 05:23:44
问题 I have a problem and I have created an empty project to reproduce the minimal situation that makes it repeatable. Problem A project with untested classes gives 100% coverage. The problematic methods are not indirectly called from somewhere else. Although there are other methods of the untested class that are indirectly called when testing another class. How to reproduce Step 1: Create an empty new symfony project. I have created a new symfony 3.3 project with this command: symfony new

Adding Code Coverage of .NET Core XUnit project to VSTS build

天大地大妈咪最大 提交于 2020-01-06 02:45:50
问题 I'd like to add the code coverage metrics to our VSTS build. The solution is ASP.NET core with XUnit. Please advise on the steps. 回答1: Refer to these steps to enable code coverage for .NET Core XUnit test: Edit projects’ files (test and related project) to add DebugType property for example: <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> <IsPackable>false</IsPackable> <DebugType>Full</DebugType> </PropertyGroup> Update Microsoft.NET.Test.Sdk package to latest version (change

How to use python coverage inside the code

眉间皱痕 提交于 2020-01-05 07:19:18
问题 I want to capture the coverage from inside the code. I tried below one but getting error. Referred to below link for coverage API. https://coverage.readthedocs.io/en/v4.5.x/api.html#api import os import pandas as pd import sys import requests import xml.etree.ElementTree as ET from xml.dom import minidom import coverage cov = coverage.Coverage() cov.start() #actual code cov.stop() cov.save() cov.html_report(directory='covhtml') getting below errors CoverageException Traceback (most recent

How to get coverage for Jest toThrow without failing test

試著忘記壹切 提交于 2020-01-05 05:09:09
问题 Let's say I'm testing the below React component with jest --coverage : class MyComponent extends React.Component { constructor(props) { super(props) if (props.invalid) { throw new Error('invalid') } } } the coverage report will say that the line throw new Error('invalid') is uncovered. Since .not.toThrow() doesn't seem to cover anything I create the below test with Enzyme: const wrapper = shallow( <MyComponent invalid /> ) it('should throw', () => { function fn() { if (wrapper.instance()

.gcda files don't merge on multiple runs

眉间皱痕 提交于 2020-01-05 04:21:31
问题 I have two main functions that use a common C++ class. File1: main.cpp #include <iostream> #include "HelloAnother.h" int main() { HelloAnother::sayHello1(); return 0; } File2: main2.cpp #include <iostream> #include "HelloAnother.h" int main() { HelloAnother::sayHello2(); return 0; } File3: HelloAnother.h #pragma once class HelloAnother { public: static void sayHello1(); static void sayHello2(); }; File4: HelloAnother.cpp #include <iostream> #include "HelloAnother.h" void HelloAnother: