code-coverage

Getting Karma, 6to5ify and Istanbul to play ball

两盒软妹~` 提交于 2019-12-22 05:04:19
问题 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 coverage preprocessor on my source files. But because istanbul (even douglasduteil/karma-coverage#next ) doesn't read my 6to5ify browserify transform, this crashes

Is there a way to merge two .gcda files into one?

谁都会走 提交于 2019-12-22 04:11:55
问题 I have several unit tests for an application, each of which is capable of generating .gcda files. I would like to be able to generate unified .gcda files which represent the coverage of my test suite as a whole. There doesn't appear to be an easy way to do this, but I could be wrong, and that's why I'm asking. With gcov, is it possible to merge to .gcda files? was previously asked and the solution was to convert to lcov .info files and merge that way. If possible, I would like the output of

Is there a way to merge two .gcda files into one?

烈酒焚心 提交于 2019-12-22 04:11:22
问题 I have several unit tests for an application, each of which is capable of generating .gcda files. I would like to be able to generate unified .gcda files which represent the coverage of my test suite as a whole. There doesn't appear to be an easy way to do this, but I could be wrong, and that's why I'm asking. With gcov, is it possible to merge to .gcda files? was previously asked and the solution was to convert to lcov .info files and merge that way. If possible, I would like the output of

MSTest Shows Partial Code Coverage on Compound Boolean Expressions

此生再无相见时 提交于 2019-12-22 04:04:54
问题 From Microsoft's documentation, partially covered code is "...where some of the code blocks within the line were not executed." I'm pretty stumped on this one (simplified for brevity): Given this method: public List<string> CodeUnderTest() { var collection = new List<string> { "test1", "test2", "test3" }; return collection.Where(x => x.StartsWith("t") && x == "test2").ToList(); } And this test: [TestMethod] public void Test() { var result = new Class1().CodeUnderTest(); CollectionAssert

How do I test code that should never be executed?

99封情书 提交于 2019-12-22 04:03:43
问题 Following method shall only be called if it has been verified that there are invalid digits (by calling another method). How can I test-cover the throw -line in the following snippet? I know that one way could be to merge together the VerifyThereAreInvalidiDigits and this method. I'm looking for any other ideas. public int FirstInvalidDigitPosition { get { for (int index = 0; index < this.positions.Count; ++index) { if (!this.positions[index].Valid) return index; } throw new

How to force Emma code coverage report to ignore some methods?

天大地大妈咪最大 提交于 2019-12-22 01:42:39
问题 Some methods, such as auto-generated getters, setters, equals and toString, are trivial for test. However, if they aren't added into the testing classes, the code coverage percentage (calculated using Emma) is reduced and may crash our system build. How can I force emma to ignore these methods in the code coverage percentage? Regards, Felipe 回答1: From the EMMA FAQ: A feature to allow EMMA users to mark arbitrary methods as excluded from coverage is being considered for future versions. So

Visual studio code coverage from many different unit test projects

眉间皱痕 提交于 2019-12-21 23:49:57
问题 I'm using visual studio 2015 Enterprise. Let's say I have my main ProjectA, and two unit test projects UnitTestsA, UnitTestsB, each containing some test methods. UnitTestsA covers 5 blocks out of 10 of my code, UnitTestsB covers 2 different blocks out of 10. When I ask visual studio to analyze code coverage, I would expect it to return 7 out of 10 blocks covered. Instead, it returns 7 out of 20 blocks covered. Seems like it doesn't realize the 2 projects are testing the same code. Am I doing

packaging jacoco-agent.properties into an APK so it can be read?

烈酒焚心 提交于 2019-12-21 22:20:57
问题 Here's my situation: Background I am investigating code-coverage for our Android app. The app is built with Gradle and Android Studio. I need code-coverage reports in two situations: during manual tests, and during automated tests built with our sizeable Appium suite. I need to get a proof-of-concept out fast (isn't that always the case?) so I haven't had the chance to do thorough R&D. So please forgive any ignorance I display :) I have access to the app source, but have little knowledge of

C++ code coverage tool running on command line [closed]

浪子不回头ぞ 提交于 2019-12-21 20:54:50
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I use code coverage tool for writing unit testing cases. I have a code coverage tool but only have to do everything through its GUI

Emma does not generate coverage.ec

▼魔方 西西 提交于 2019-12-21 20:10:20
问题 I setup Emma and it used to work for me. Then we had source code changes and now it doesn't generate coverage.ec at all. It does generate coverage.em . Near the end of testing, it has error messages: [exec] INSTRUMENTATION_CODE: 0 [echo] Downloading coverage file into project directory... [exec] remote object '/sdcard/coverage.ec' does not exist BUILD FAILED /var/lib/jenkins/android-sdk-linux_x86/tools/ant/build.xml:1056: exec returned: 1. Line 1056 of build.xml is "{adb}" failonerror="true".