code-coverage

Only coverage for test classes in opencover

爷,独闯天下 提交于 2019-12-23 09:49:38
问题 I have a problem to get the coverage from my classes with opencover. I have a Viewer.dll with the main classes and a Viewer_Test.dll with the tests for the viewer. After executing the commands all tests run as expected. OpenCover.Console.exe -register:user -target:"$(nunitpath)/nunit-console-x86.exe" -targetargs:"/noshadow Viewer_Tests.dll /domain:single" -filter:+[*]* -output:coverage.xml ReportGenerator.exe coverage.xml "coveragereport" html If I look in the generated report I find only the

JaCoCo: missing classes directory

 ̄綄美尐妖づ 提交于 2019-12-23 09:34:05
问题 I am fairly new to JaCoCo and I am having trouble generating my code coverage report. This is my project structure: My integration tests live within the "...-integration-tests" module. When I build my project using mvn I get the following in my logging: [INFO] Skipping JaCoCo execution due to missing classes directory: ...-integration-tests\target\classes This is true because my compiled code is only available in the target>classes of the corresponding module. What is the best way to make

How to detect code-coverage of separated folders in GO?

家住魔仙堡 提交于 2019-12-23 07:48:11
问题 My project-structure stuff/stuff.go -> package: stuff test/stuff/stuff_test.go -> package: test Although stuff_test executes code from stuff.go it shows coverage: 0.0% of statements I used go test -cover If I move my *_test.go to the stuff-folder of the program it is working fine. Or perhaps my approach of the project-structure is not well designed/go-conform? 回答1: Cross-package test coverage is not directly supported, but several people have built wrappers to merge individual coverage

Log line numbers of executed java code

社会主义新天地 提交于 2019-12-23 07:01:17
问题 I am writing part of a PHP web application (which will be used in a high school bug finding contest) where the user must find bugs in a given Java program. As a part of this, when the Java program executes, we want to highlight the lines of the source of the Java program where the code has executed. To do this, all we need are the line numbers of the source that have been executed, that is, the code path (or is it called code coverage?). We will highlight the lines in the source file using

Exclude package from jacoco code coverage for Android

陌路散爱 提交于 2019-12-23 03:42:21
问题 I'm trying to exclude generated files by GreenDao framework, which placed in a package named dao, from my code coverage report generated by Jacoco, but creating a custom task like following doesn't work. def coverageSourceDirs = [ '../app/src/main/java' ] task jacocoTestReport(type: JacocoReport, dependsOn: "testDebug") { group = "Reporting" description = "Generate Jacoco coverage reports after running tests." reports { xml.enabled = true html.enabled = true } classDirectories = fileTree( dir

Showing D Coverage Results as Overlays in Source Buffer

风格不统一 提交于 2019-12-23 03:32:22
问题 The D language compiler DMD outputs its coverage analysis in a file containing the original source as | inout(Ix)[] prefix() inout | { 2037| assert(!keys.empty); 2037| final switch (keys.length) | { 000000000| case 1: 000000000| return keys.at!0[]; 2037| case 2: | import std.algorithm.searching : commonPrefix; 2037| return commonPrefix(keys.at!0[], keys.at!1[]); | } | } that is, the original source where each line has been prefixed by a 10-character column containing the execution count (if

JaCoCo with microservice project architecture?

孤者浪人 提交于 2019-12-23 03:03:19
问题 My project consists of 6 microservices in java and I am trying to figure out how to merge the html reports from Jacoco into one overall coverage report. As it stands now I end up with a report for each service and it would be nice to have an aggregated one so I can more easily put it into our CI for visibility etc. I've tried various things I've found on web searches, but I end up with an empty coverage file when I try those suggestions. Here is my gradle file: subprojects { apply plugin:

How to test unlikely concurrent scenarios?

筅森魡賤 提交于 2019-12-22 19:32:32
问题 For example, map access like this: func (pool *fPool) fetch(url string) *ResultPromise { pool.cacheLock.RLock() if rp, pres := pool.cache[url]; pres { pool.cacheLock.RUnlock() return rp } pool.cacheLock.RUnlock() pool.cacheLock.Lock() if rp, pres := pool.cache[url]; pres { pool.cacheLock.Unlock() // Skip adding url if someone snuck it in between RUnlock an Lock return rp } rp := newPromise() pool.cache[url] = rp pool.cacheLock.Unlock() pool.c <- fetchWork{rp, url} return rp } Here, the

How to test unlikely concurrent scenarios?

安稳与你 提交于 2019-12-22 19:32:13
问题 For example, map access like this: func (pool *fPool) fetch(url string) *ResultPromise { pool.cacheLock.RLock() if rp, pres := pool.cache[url]; pres { pool.cacheLock.RUnlock() return rp } pool.cacheLock.RUnlock() pool.cacheLock.Lock() if rp, pres := pool.cache[url]; pres { pool.cacheLock.Unlock() // Skip adding url if someone snuck it in between RUnlock an Lock return rp } rp := newPromise() pool.cache[url] = rp pool.cacheLock.Unlock() pool.c <- fetchWork{rp, url} return rp } Here, the

How to test unlikely concurrent scenarios?

南笙酒味 提交于 2019-12-22 19:32:09
问题 For example, map access like this: func (pool *fPool) fetch(url string) *ResultPromise { pool.cacheLock.RLock() if rp, pres := pool.cache[url]; pres { pool.cacheLock.RUnlock() return rp } pool.cacheLock.RUnlock() pool.cacheLock.Lock() if rp, pres := pool.cache[url]; pres { pool.cacheLock.Unlock() // Skip adding url if someone snuck it in between RUnlock an Lock return rp } rp := newPromise() pool.cache[url] = rp pool.cacheLock.Unlock() pool.c <- fetchWork{rp, url} return rp } Here, the