code-coverage

How do the code coverage options of GCC work?

旧城冷巷雨未停 提交于 2019-12-21 12:44:34
问题 Consider the following command: gcc -fprofile-arcs -ftest-coverage main.c It generates the file, main.gcda, which is to be used by gcov, to generate the coverage analysis. So how does main.gcda is generated? How the instrumentation is done? Can I see the instrumented code? 回答1: .gcda is not generated by compiler; it's generated by your program when you execute it. .gcno is the file generated at compilation time and it is the 'note file'. gcc generate a basic block graph notes file (.gcno) for

How to get travis to fail if tests do not have enough coverage for python

旧时模样 提交于 2019-12-21 12:01:45
问题 I it possible to have travis fail if my test don't have enough coverage, say < 90% for example. Normally I run my tests with the following travis config entry. script: - coverage run --source="mytestmodule" setup.py test 回答1: According to this link, if you add the --fail-under switch to the coverage report command, it will exit with a non-zero exit code (which travis will see as a failure) if the code coverage is below the given percentage. That would make the script section of your .travis

Visual Studio 2012 Code Coverage

爱⌒轻易说出口 提交于 2019-12-21 11:03:13
问题 We have very complex web based product including solid number of web services etc. I'm trying to collect code coverage for all assemblies in our product using VS 2012 command line utility vstest.console.exe. It is pretty easy to collect code coverage for Unit Tests, however, there is no flag or switch that indicates that I can attach the process to IIS or collect info for web services (both client and server sides). Any suggestions? 回答1: Detailed instructions for collecting code coverage from

VS2015 Code Coverage not working with tests in ASP.NET Core 1.0 (formerly known as ASP.NET 5)

谁都会走 提交于 2019-12-21 10:33:29
问题 I have a an ASP.NET Core 1.0 (previously known as ASP.NET 5) solution with a couple of Class Library (Package)'s and an ASP.NET MVC6 project. I have a test library using the new XUnit 2.0 which supports Core 1.0. However, for some reason my code coverage is producing zero results when running it on all of my tests which are passing. By default, ASP.NET Core 1.0 projects are built in-memory by the runtime and no artifacts are persisted to disk. So in the settings I enabled "Produce all outputs

PHPUnit Code Coverage

风流意气都作罢 提交于 2019-12-21 07:24:18
问题 I am learning the ropes with Unit testing Zend Framework applications. So far I have set up PHPUnit to work with Zend Framework and have started writing some simple Test Cases. My issue is that I am wondering why Code Coverage does not work in spite of being set in the logging tag in my phpunit.xml . I don't get any error but no coverage report is generated. However it works when I run phpunit --coverage <dir> The logging section of my phpunit is as below: <phpunit bootstrap="./application

preventing python coverage from including virtual environment site packages

北城以北 提交于 2019-12-21 06:47:08
问题 I am new to coverage and ran into a strange problem. My coverage is taking my virtual environment site packages into account. Here is the output of the coverage run: coverage run test.py .................... ---------------------------------------------------------------------- Ran 20 tests in 0.060s OK (atcatalog)- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -jmfrank63@fullstack-audio-text-catalog:~/workspace (git master) [19:58:45] $ coverage report Name Stmts Miss

Coverage view shows 0.0% in Intellij when using Jacoco

不羁岁月 提交于 2019-12-21 06:46:20
问题 As discussed in Open JaCoCo report in Intellij IDEA, when I gather code coverage statistics using Jacoco (rather than native IntelliJ tracing) 0.0% (i.e. "no" coverage) is always shown in the coverage window. This is after I have done the whole "Analyze -> Show coverage data..." and selected my generated "jacoco.exec" file. The same "jacoco.exec" file works fine with other tools such as the Jacoco native report generation task, and with Sonar, and these produce the expected coverage report

Running tests from coverage.py vs running coverage from test runner

寵の児 提交于 2019-12-21 05:52:32
问题 During the Coverage.py with Ned Batchelder python&testing podcast, Brian and Ned briefly discussed that, if you need to run tests with coverage, it is preferred to run tests from coverage.py executing the coverage run as opposed to invoking a test runner with coverage. Why is that and what is the difference? To put some context into this: currently I'm using nose test runner and execute the tests with the help of nosetests command-line tool with --with-coverage option: $ nosetests --with

Running tests from coverage.py vs running coverage from test runner

╄→гoц情女王★ 提交于 2019-12-21 05:52:12
问题 During the Coverage.py with Ned Batchelder python&testing podcast, Brian and Ned briefly discussed that, if you need to run tests with coverage, it is preferred to run tests from coverage.py executing the coverage run as opposed to invoking a test runner with coverage. Why is that and what is the difference? To put some context into this: currently I'm using nose test runner and execute the tests with the help of nosetests command-line tool with --with-coverage option: $ nosetests --with

Running tests from coverage.py vs running coverage from test runner

不羁岁月 提交于 2019-12-21 05:52:02
问题 During the Coverage.py with Ned Batchelder python&testing podcast, Brian and Ned briefly discussed that, if you need to run tests with coverage, it is preferred to run tests from coverage.py executing the coverage run as opposed to invoking a test runner with coverage. Why is that and what is the difference? To put some context into this: currently I'm using nose test runner and execute the tests with the help of nosetests command-line tool with --with-coverage option: $ nosetests --with