gcov

How do I generate coverage reports for fork()'d children using gcov/lcov?

我的未来我决定 提交于 2019-12-06 03:44:08
问题 I'm having trouble generating coverage reports for a project of mine -- it seems that the lines in the child process after a fork are never hit, althought they clearly are in reality. Here is the coveralls report of the forking part (The results are the same with lcov+genhtml), and the build logs. The project uses autotools with libtool to build, and packs everything as a static library. (configure.ac, library makefile.am, tests makefile.am) I tried to add the coverage flags to the tests, and

What are your tips for interpreting gcov output in order to improve coverage?

一笑奈何 提交于 2019-12-06 03:10:49
问题 I'm successfully using gcov in my project: I can build my project with gcov flags: -fprofile-arcs -ftest-coverage I link with the -lgcov option I run my unit test program and lots of gcda and gcno files are produced. I run gcov lots of times and lots of gcov files are produced. I summarise the results and produce a list of lines like this: #####: 42: virtual double run_time() const { return 0; } I then go 'doh!' and write a test which calls that missing method. The above example line is quite

gcov creates .gcov files in the current directory. Is there any way to change this?

我怕爱的太早我们不能终老 提交于 2019-12-06 02:31:52
I'm running gcov/gcc 4.1.2 on RHEL. When I want to specify a directory for the gcov files. Any ideas on how to do this? Run gcov from the directory where you want its files to be created. You'll have to use the -o argument to tell it where to look for the .gcno/.gcda files. See gcov's docs for more info. 来源: https://stackoverflow.com/questions/1759475/gcov-creates-gcov-files-in-the-current-directory-is-there-any-way-to-change-th

C++ using GCOV/LCOV in a CMake project

独自空忆成欢 提交于 2019-12-06 00:07:47
问题 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

Eclipse gcov missing highlighting in code

不羁岁月 提交于 2019-12-05 22:15:21
I build my C++ project with "Generate gcov information", I run it under the "Gcov" profiler from the Linux Tools repository, and I get a nice coverage overview in the "gcov" view. But when I double click a file (one with about 92 % for example) the editor view that pops up has no coverage highlighting. I observe this on both x86_64/xenial/Mars and i386/hardy/Luna. What am I doing wrong? 来源: https://stackoverflow.com/questions/37851722/eclipse-gcov-missing-highlighting-in-code

Can GCov be used in windows?

我与影子孤独终老i 提交于 2019-12-05 10:58:28
Can I install gcov tool in windows? Or can I take plug-in of this tool in eclipse in windows? I am very new to this tool. I don't have any idea about this tool. Please help me to get the information of this tool. please tell me the requirements to run this tool on my machine. Where can I get more information about gcov and also please provide a link from where I can download this tool. Does gcov tool accepts only c/c++ files or it also takes header files(*.h) as input? Can I install gcov tool in windows? Yes. We use gcc to build QNX projects in Windows. Where can I get more information about

How does one get the actual function names from these output

为君一笑 提交于 2019-12-05 03:39:38
I use boost test for unit testing and gcov and lcov for measuring the coverage. Unfortuanlly genhtml generates reports like that for function coverage: I now want to know what the function _ZN7UtilLib11ProgressBarC2EjdRSo actually is. So far I can not correlate this function to any of the class interface of ProgressBar: class ProgressBar { public: explicit ProgressBar( unsigned int expected_count, double updateInterval = 30, std::ostream& os = std::cout); unsigned int operator+=(unsigned int increment); unsigned int operator++(); unsigned int operator++(int i); } Can any one help me how to

Is it possible code coverage of a shared library using gcov?

元气小坏坏 提交于 2019-12-05 02:05:38
问题 I try to test an executable which uses OpenCV shared library. When using gcov to know what code lines were covered I only get info about my .cpp files and .hpp of the library. No info is shown about .cpp files of the library. I compiled and linked with -pg --coverage flags. 回答1: Yes, gcov can give coverage information about a shared library. If I remember correctly from the problems I had getting this to work on my project, you're probably not including the --coverage flag on the linking of

Why does gcov report in-class function definitions as not executable?

家住魔仙堡 提交于 2019-12-04 18:58:46
It seems like gcov does not report inline definitions of class methods as executable lines. Example: #include <iostream> struct Foo { void bar() {} void baz() {} }; int main() { Foo foo; foo.bar(); } If I compile the above program with g++ -g -O0 -ftest-coverage -fprofile-arcs -o main main.cpp , run it, and call gcov on it, I get the following report: -: 0:Source:main.cpp -: 0:Graph:main.gcno -: 0:Data:main.gcda -: 0:Runs:1 -: 0:Programs:1 -: 1:#include <iostream> -: 2: -: 3:struct Foo { 1: 4: void bar() {} -: 5: void baz() {} -: 6:}; -: 7: 1: 8:int main() { -: 9: Foo foo; 1: 10: foo.bar(); 4:

Is code coverage already working for Swift?

亡梦爱人 提交于 2019-12-04 15:37:23
问题 I am trying to setup test code coverage for a Swift application on Xcode 6 Beta 4. I was able to do so in the past using ObjectiveC with Xcode 5, however I think I had to call the void __gcov_flush() method, to trigger generation of the .gcda/.gcno files. I set both properties for instrumentation and code coverage to YES for the app and test targets. However after running the tests, when I look in: DerivedData/some subfolders/i386 all I see are files of type: .d,.dia,.o,.swiftmodule and so on