emma

Emma code coverage with JUnit and Powermock

£可爱£侵袭症+ 提交于 2019-12-10 21:31:31
问题 I am using JUnit with Powermockito mocking. I have to work on a CLI environment with maven or ant. emma version: ema-2.0.5312 powermock version: powermock-mockito-1.5.1-full junit version: junit-4.9 When I run junit through the following command, everything works find: java org.junit.runner.JUnitCore some.package.ClassTest However, when I used emma to check the code coverage: java emmarun -cp $CLASSPATH -report txt org.junit.runner.JUnitCore some.package.ClassTest I got the following error: 1

How can I remove/filter/ignore some package from Emma (code coverage)

我们两清 提交于 2019-12-10 13:23:00
问题 I`m trying to remove some package from my report and having trouble. Could some one give me some help? I'm using EMMA in my ant process. <!-- Generate the emma report both in xml and html --> <emma> <report sourcepath="${build.report.src}" metrics="class:${coverage.classes.min},method:${coverage.methods.min}"> <fileset dir="${build.report.junit.data.dir}"> <include name="*.emma"/> </fileset> <html outfile="${build.report.reports}/emma/raw.html" depth="method"/> <xml outfile="${build.report

ClassFormatError using JMockit with EMMA

谁说胖子不能爱 提交于 2019-12-10 10:26:09
问题 I am trying to use EMMA to measure coverage of some JUnit tests that use JMockit. But when I try to run the JMockit tests after instrumenting with EMMA, about a quarter of the tests fail with the following error: com.logstorage.engine.sensor.SensorManagerTest.setUpBeforeClass(SensorManagerTest.java:98) java.lang.ClassFormatError at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method) at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:150) at mockit

Clearing coverage highlighting in Eclipse

笑着哭i 提交于 2019-12-09 04:03:58
问题 After running coverage reports in Eclipse (using cobertura or an EMMA plugin), my source code files get highlighted in green, red and yellow depending on which lines of code were covered by tests. How can I clear this highlighting after I'm done? 回答1: Click the "Remove all Sessions" button in the toolbar of the "Coverage" view. 回答2: On 4.2 eclipse it seems to be impossible to remove the eCobertura highlights. Sadly eCobertura plugins seems to be not maintained anymore. However if you start

Generating android code coverage though changes in build.xml and ant.properties

时光毁灭记忆、已成空白 提交于 2019-12-08 02:54:05
问题 I have been trying to generate android code coverage for my android test project which tests a android project which includes a external jar. When I run command ant emma install debug test it shows coverage of only the android project but does not include the package and functions of the external jar included. As per my researches I have found that some changes should be done in ant.properties file and emma report tag in build.xml . Any suggestions are most welcome. [Edit] On furthur study, I

Emma code coverage for a lib on Android

老子叫甜甜 提交于 2019-12-07 09:41:19
问题 I currently have some unit tests for an Android app, which makes calls to a library jar file. I would like to see the code coverage for the jar, but when I run ant emma and look at the coverage.html, it only reports on the coverage of the app project. Is there a way to specify that I would like to view the coverage for the jar as well? 回答1: The ADT r20-preview solves this issue by giving access to the full classpath of tested projects and their Library Projects: http://tools.android.com

How to calculate code coverage in Hudson using emma for a multi-module maven project but only run tests once

假装没事ソ 提交于 2019-12-07 02:24:28
We have several multi-module projects which I want to run emma against, but I don't want the tests to be run twice, because this results in misleading statistics on the Hudson project home page as unit tests are counted twice. For a single module project, we can ommit the install goal and just use clean emma:emma to run the tests once, is there any way we can test only using emma instrumented byte code and then build & install the project artifacts without running the tests a second time? Using -Dmaven.tests.skip=true causes emma to fail. For a full release (i.e. mvn release:perform) the tests

eclemma - how to ignore source

陌路散爱 提交于 2019-12-06 17:00:56
问题 I'm using junit/eclemma; it works great, except I'd like to instruct eclemma to ignore certain methods or classes. For example, how would i instruct eclemma to ignore getters/setters. Thanks in advance! 回答1: You can specify in the preferences which classes to ignore using a regexp ("Only path entries matching"). See http://www.eclemma.org/userdoc/preferences.html for details. I don't think you can ignore methods though. 来源: https://stackoverflow.com/questions/2937645/eclemma-how-to-ignore

Generating android code coverage though changes in build.xml and ant.properties

一笑奈何 提交于 2019-12-06 14:08:24
I have been trying to generate android code coverage for my android test project which tests a android project which includes a external jar. When I run command ant emma install debug test it shows coverage of only the android project but does not include the package and functions of the external jar included. As per my researches I have found that some changes should be done in ant.properties file and emma report tag in build.xml . Any suggestions are most welcome. [Edit] On furthur study, I went through a blog which says enter the variable tested.android.library.source.dir="path to external

How can I use filter for emma when building Android test with ant for a library project?

▼魔方 西西 提交于 2019-12-06 05:42:10
问题 From this question : How can I use filter for emma when building Android test with ant? I know emma can use a filter by adding the following lines to my ant.properties of the targeted project, not the test project, emma.filter=-com.your.excluded.package.* but it seems it doesn't work properly if my target project is a library project. My workspace looks like this: projectlib1 : lib project using lib2 projectlib1/tests : unit tests for lib1 projectlib2 : lib project using lib3 projectlib2