gcov

How to find the coverage of a library opened using dlopen()?

余生长醉 提交于 2019-12-12 09:58:07
问题 I have a C++ library (.so) which is opened using dlopen() by another application. But I need to find the code coverage of this library while run within the application using gcov. Is it possible? If yes, how can it be done? If not, how can the issue be resolved? 回答1: Firstly have your compiled your C++ library with the --coverage flag? I've never actually used a '.so' library with gcov before, so I'm not sure it would work anyway. Secondly could you arrange a test version of your application

Cannot generate coverage report using lcov

ぃ、小莉子 提交于 2019-12-12 05:37:37
问题 I'm trying to use lcov to generate coverage reports for my unit test suite, but I cannot even capture a tracefile. The error messages indicate that the source files cannot be found. The code is compiled by a Jenkins job on a build machine and the unit test are executed as a downstream job on a target machine. The source code and gcno files are transfered to the downstream job, which then executes the call to lcov. Here follows all the details, a cup of coffee might be needed. On the build

Using gcov with shared objects used by executable

泪湿孤枕 提交于 2019-12-11 14:48:45
问题 I am trying to generate coverage report for my project. the .gcno files are generated as expected for the shared object code files, but when I run the executable (which uses the shared object generated), .so is also present in same location as executable but .gcda files for shared object doesnot get generated whereas .gcda files for executable code is generated as expected. Is there something wrong in approach? PLEASE ADVISE 回答1: Its possible to get coverage for shared libarary. i tried

gcc gprof/gcov/other - how to get sequence of function calls/exits + control flow statements

给你一囗甜甜゛ 提交于 2019-12-11 05:06:44
问题 BACKGROUND We have testers for our embedded GUI product and when a tester declares "test failed", sometimes it's hard for us developers to reproduce the exact problem because we don't have the exact trace of what happened. We do currently have a logging framework but us devs have to manually input those logging statements in the code which is fine . . . except when a hard-to-reproduce bug occurs and we didn't have a log statement at the 'right' location and then when we re-build, re-run the

LCOV to exclude entire packages from code coverage analysis

回眸只為那壹抹淺笑 提交于 2019-12-11 04:43:39
问题 I'm using LCOV as my graphical means of code coverage to tell me how much of my code I've tested, however it's including folders of code which I do not care about and it's making my coverage lower than it should actually be. Is there a way exclude entire directories where I can ignore a bunch of cpp files which I don't care about? I know about --remove but this doesn't seem to work for this purpose. I want to exclude all folders following this pattern: Src/GeneralSubSystems/GA/ except for

How to deal with .gcda and .gcno files in different directory by lcov & code coverage compare

≡放荡痞女 提交于 2019-12-10 20:41:56
问题 I can generate .info files by lcov with .gcda files and .gcno files in the same directory, BUT how can I generate code coverage with .gcda files and .gcno files in defferent location? For example, /Users/swd/Library/Developer/Xcode/DerivedData/test1aaeyiowcssrymfbwtudrqqakuvr/Build/Intermediates/test1.build/Cov/test1.build/Objects-normal/x86_64/AppDelegate.gcno /Volumes/Data/test1/test1/AppDelegate.gcda I tried --add-tracefile but failed, and output 'lcov: ERROR: no valid records found in

Can GCov be used in windows?

核能气质少年 提交于 2019-12-10 05:21:11
问题 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? 回答1: Can I install gcov

Finding non-instantiated templates in C++ code

谁都会走 提交于 2019-12-10 02:58:49
问题 What is the best way to find uninstantiated templates in C++ Code? I have a code base that heavily uses templates. Of course, we want to make sure that the test coverage is high. For all used code, this works very well using gcov . However, unused templates are reported as non-executable by gcov . After some googling, it appears that there is no way to force g++ to emit code for these templates (which is only logical, how should the compiler guess any types?) It also appears that there is no

Understanding branches in gcov files

杀马特。学长 韩版系。学妹 提交于 2019-12-09 12:02:50
问题 I'm trying to understand the output of the gcov tool. Running it with no options makes sense, but I'm wanting to try and understand the branch coverage options. Unfortunately it's hard to make sense of what the branches do and why they aren't taken. Below is the output for a method (compile using the latest LLVM/Clang build). function -[TestCoverageAppDelegate loopThroughArray:] called 5 returned 100% blocks executed 88% 5: 30:- (NSInteger)loopThroughArray:(NSArray *)array { 5: 31: NSInteger

iPhone: Cannot get simulator to generate .gcda profiling data files

天涯浪子 提交于 2019-12-08 16:53:38
问题 I'm attempting to profile my code using the iPhone simulator. I've enabled Generate Test Coverage File and Instrument Program Flow and added -lgcov to the linker flags. According to everything I've read that should be all I need to do in terms of setup. Update: Generate Test Coverage File triggers the -ftest-coverage flag and Instrument Program Flow triggers the -fprofile-arcs flag. I've checked the build logs and they are being set when compiling. Executing the program I can see the .gcno