lcov

Why doesn't lcov report exception coverage?

痴心易碎 提交于 2019-12-04 19:38:48
Refer to this coverage report . . I know that my test cases are exercising the exception handling, however the lines are still being reported as not covered. . . This has been the case in all of my objective-c projects for a while now. . . . is there a way to fix this? 来源: https://stackoverflow.com/questions/14796711/why-doesnt-lcov-report-exception-coverage

C++ using GCOV/LCOV in a CMake project

我只是一个虾纸丫 提交于 2019-12-04 05:50:36
I'm working in a C++ Project with a structure similiar to the following: --- /src |--comms |--utils |--interfaces … CMakeList.txt --- /test |---test1/ |--main.cpp |--CMakelists.txt --CMakeLists.txt I do need to control the coverage of my tests and for this purpose I use GCOV and LCOV in this way: Enable coverage flags in all CMakeLists.txt to let the generation of .gcno files. SET(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage") SET(CMAKE_C_FLAGS "-g -O0 -Wall -W -fprofile-arcs -ftest-coverage") SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage") Run test, generating the

How to change the format of the LCOV report executed by Karma?

∥☆過路亽.° 提交于 2019-12-03 18:46:50
问题 I've configured Karma to report the coverage of my JavaScript code. Here is the part of the configuration in the karma.conf.js file: coverageReporter: { reporters: [ { type: 'html', dir: 'build/karma/coverage' }, { type: 'lcov', dir: 'build/karma/coverage', subdir: '.' }, { type: 'cobertura', dir: 'build/karma/coverage' } ] }, My lcov.info file has the following format: TN: SF:./app/scripts/app.js FN:16,(anonymous_1) FN:26,(anonymous_2) FNF:2 FNH:1 FNDA:1,(anonymous_1) FNDA:0,(anonymous_2) DA

LCOV_EXCL_START/STOP has no effect when using gcovr

自作多情 提交于 2019-12-02 21:09:24
问题 When I add LCOV_EXCL_START/STOP tags to my C++ code, it does not seem to have any effect on my gcovr report. Does someone know why this occurs? I have the following: $ tree . ├── build ├── include │ └── a.h └── tests └── test_a.cpp and $ cat include/a.h void f (bool x) { // LCOV_EXCL_START if (x) throw 1; // LCOV_EXCL_STOP } and $ cat tests/test_a.cpp #include "a.h" int main () { f (false); return 0; } But line 5 throw 1; is included in the gcovr report, even though it is surrounded in

LCOV_EXCL_START/STOP has no effect when using gcovr

我的未来我决定 提交于 2019-12-02 08:46:47
When I add LCOV_EXCL_START/STOP tags to my C++ code, it does not seem to have any effect on my gcovr report. Does someone know why this occurs? I have the following: $ tree . ├── build ├── include │ └── a.h └── tests └── test_a.cpp and $ cat include/a.h void f (bool x) { // LCOV_EXCL_START if (x) throw 1; // LCOV_EXCL_STOP } and $ cat tests/test_a.cpp #include "a.h" int main () { f (false); return 0; } But line 5 throw 1; is included in the gcovr report, even though it is surrounded in exclude tags: $ g++ -c -O0 -fprofile-arcs -ftest-coverage -fPIC --coverage -I include ./tests/test_a.cpp -o .

ERROR while code coverage report using lcov

北慕城南 提交于 2019-12-01 10:52:48
I am trying to run coverage on my project, after updating to Ubuntu 16.04. I get Deleted 665 files Writing data to coverage.info.cleaned lcov: ERROR: cannot write to coverage.info.cleaned! CMakeFiles/coverage.dir/build.make:57: recipe for target 'CMakeFiles/coverage' failed make[3]: *** [CMakeFiles/coverage] Error 13 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/coverage.dir/all' failed make[2]: *** [CMakeFiles/coverage.dir/all] Error 2 CMakeFiles/Makefile2:74: recipe for target 'CMakeFiles/coverage.dir/rule' failed make[1]: *** [CMakeFiles/coverage.dir/rule] Error 2 Makefile:129:

ERROR while code coverage report using lcov

不羁岁月 提交于 2019-12-01 08:04:56
问题 I am trying to run coverage on my project, after updating to Ubuntu 16.04. I get Deleted 665 files Writing data to coverage.info.cleaned lcov: ERROR: cannot write to coverage.info.cleaned! CMakeFiles/coverage.dir/build.make:57: recipe for target 'CMakeFiles/coverage' failed make[3]: *** [CMakeFiles/coverage] Error 13 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/coverage.dir/all' failed make[2]: *** [CMakeFiles/coverage.dir/all] Error 2 CMakeFiles/Makefile2:74: recipe for target

How to tell lcov to ignore lines in the source files

﹥>﹥吖頭↗ 提交于 2019-11-30 18:10:59
I am wondering if there is the possibility to tell lcov to ignore some lines in a source files, ie. do not report them as unvisited. I am looking for a solution that can be put in the code itself, like: int some_method(char some_var, char some_other_var) { if(some_var == 'A') { if(some_other_var == 'B') { /* do some real stuff here */ } else { LCOV_DO_NOT_REPORT_NEXT_LINE // **<-- this?? ** NOT_IMPLEMENTED("A*") } } else { NOT_IMPLEMENTED("*") } And the necessary background: A big piece of code like the one above is being tested in a series of unit tests, but since this code is still under

Is there any actively supported lcov port for windows

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 15:12:54
I measure coverage for my code using gcov library and I would like to generate coverage report in user-friendly format. I've found lcov utility for that, but it's not compatibile with Windows environment (mainly because of the way the paths are parsed). Does anyone know about actively supported lcov port for Windows? It seems that making it work on Windows would be quite easy (it think it might even be solved by few creative batch/perl scripts that mimic the behavior of unix shell commands), and the tool is quite useful, so I suppose someone might have already done it. John Paulett While it

XCode 5.1 Unit Test Coverage Analysis Fails On Files Using Blocks

霸气de小男生 提交于 2019-11-30 06:18:58
问题 Today I was tasked with adding unit test coverage analysis to our code base. Today is also the day iOS 7.1 is released along with XCode 5.1. From the release notes: The gcov tool for code coverage testing has been reimplemented. The new version uses the llvm-cov tool from the LLVM project. It is functionally equivalent to the old version for all significant features. The location of gcov within Xcode has also moved, use xcrun to invoke it. If you find problems, please file bug reports. For