cobertura

Grails / Cobertura report - conditional coverage doesn't make sense

江枫思渺然 提交于 2019-11-30 08:25:25
问题 What could cause something like this: The line def result shows only 2/6 branches covered, even though it has NO BRANCHES, while the following line, which actually has a conditional, is ok. What's going on? I verified that the cobertura.ser is getting cleaned up between builds. 回答1: any idea where I can get the source for that JAR? jar and souce code for disableOptimizationsTransformation Also - any idea how to include that JAR on classpath ONLY for the test-app build phase? // Remove the jar

What is the proper way to use Cobertura with Maven 3.0.2

自古美人都是妖i 提交于 2019-11-30 06:06:14
I have been trying unsuccessfully for the last few days to run Cobertura 2.4 with Maven 3.0.2. We have a very large project with many modules (sub-projects). What I found is that documentation is basically non-existent or plain wrong. All tutorials I was able to find don't work with Maven 3.x (they build, but Cobertura either doesn't run or cannot generate the reports). Has anyone here been able to make it work? Any useful tips/examples? Thanks. I successfully integrated Cobertura in my projects with adding this: <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId

How to generate Cobertura Code Coverage Report using Maven from Hudson

独自空忆成欢 提交于 2019-11-30 04:43:44
In my project I need to create Cobertura Code Coverage report from Hudson using maven build. In Hudson I have added the Cobertura Code Coverage plugin. I need the complete modification steps of pom.xml. Did you try to add this to your pom.xml in the reporting section? <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> Complete configuration steps can be found here . Hudson needs a you to generate the coverage.xml file. To do this without changing

Is there anyway to merge cobertura coverage xml reports together?

有些话、适合烂在心里 提交于 2019-11-30 03:06:45
问题 I have c++/c application with a lots of unit tests. I would like to get overall coverage and also individual coverage of each test with condition that each test can be run only once. Format of coverage must be xml (cobertura xml) for jenkins cobertura plugin to process. So far I generate gcno files upon compilation and gcda files when source is used. Then call gcovr to get xml file. I would like to create coverage of each unit test (thus creating coverage xml for every unit test) and then

Differences between Line and Branch coverage

霸气de小男生 提交于 2019-11-29 19:30:12
I use the Cobertura Maven plugin for one of my project. But I have a question about the generated report: What is the difference between line and branch coverage? Kane Line coverage measures how many statements you took (a statement is usually a line of code, not including comments, conditionals, etc). Branch coverages checks if you took the true and false branch for each conditional (if, while, for). You'll have twice as many branches as conditionals. Why do you care? Consider the example: public int getNameLength(boolean isCoolUser) { User user = null; if (isCoolUser) { user = new John(); }

Running integration tests with Cobertura Maven plugin

久未见 提交于 2019-11-29 16:01:11
问题 I am having trouble getting the Cobertura plugin to run integration tests in Maven. The closest answer to this question I have found is http://jira.codehaus.org/browse/MCOBERTURA-86. However, the issue remains an open bug. I tried the configuration suggested by Stevo on 03/Apr/09, it didn't work. My POM <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.3-SNAPSHOT</version> <reportSets> <reportSet> <reports> <report

How to make SonarQube module analyze the project only once when sonar analysis is bound to maven lifecycle in a multi-module project?

白昼怎懂夜的黑 提交于 2019-11-29 11:01:43
What I am trying to achieve is integrate SonarQube analysis into the build process, so that whenever mvn clean install is run, the code is analyzed with SonarQube. We want to use it for local analysis and also for build on Jenkins. If new issues are found, than the build should fail (we want to use build breaker plugin for that). This way the developer would know that by his code his is going to introduce new issues, and will have to fix them for the build to work. When I run mvn sonar:sonar , the analysis takes 30 seconds, which is OK. However, the problem occurs when I am trying to bind

What is the proper way to use Cobertura with Maven 3.0.2

╄→尐↘猪︶ㄣ 提交于 2019-11-29 05:55:10
问题 I have been trying unsuccessfully for the last few days to run Cobertura 2.4 with Maven 3.0.2. We have a very large project with many modules (sub-projects). What I found is that documentation is basically non-existent or plain wrong. All tutorials I was able to find don't work with Maven 3.x (they build, but Cobertura either doesn't run or cannot generate the reports). Has anyone here been able to make it work? Any useful tips/examples? Thanks. 回答1: I successfully integrated Cobertura in my

Cobertura on Tomcat

自古美人都是妖i 提交于 2019-11-29 02:22:28
I'm trying to apply code coverage using Cobertura. The app is deployed in Tomcat 5, but when I instrument the .class files, the app stops working. This are my steps: Compile the app (This run in tomcat) Instrument the class files. D:\test\cobertura-1.9.4.1\cobertura-instrument.bat --destination D:\test\instrument D:\src\path_to_app\main\target\webapp Overwrite the class files of D:\src\path_to_app\main\target\webapp with the instrumented class files in D:\test\instrument . Deploy the app in Tomcat via Catalina conf or by a war file. (The app does not work) Does someone have the correct steps

How to generate Cobertura Code Coverage Report using Maven from Hudson

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 02:02:31
问题 In my project I need to create Cobertura Code Coverage report from Hudson using maven build. In Hudson I have added the Cobertura Code Coverage plugin. I need the complete modification steps of pom.xml. 回答1: Did you try to add this to your pom.xml in the reporting section? <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> Complete configuration