gcov

gcov final link failed

只谈情不闲聊 提交于 2019-12-23 17:33:40
问题 While compiling my project with gcov support I am facing the below error Following are flags information i have while compiling compiler flags: CXXFLAGS="-Wno-deprecated -g -ggdb -fprofile-arcs -ftest-coverage -fPIC" linker options: LINK_CMD="gcc -fprofile-arcs -fPIC" Following are version information: gcc version: gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) gcov version: gcov (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44) error: hidden symbol `__gcov_init' in /usr/lib/gcc/x86_64-redhat-linux/4.1

Gcov reporting that return statement is not hit

余生长醉 提交于 2019-12-23 02:41:27
问题 gcov complains about one of my algorithms: File 'Algorithm.h' Lines executed:95.00% of 20 Algorithm.h:creating 'Algorithm.h.gcov' 17: 25:inline std::vector<std::string> starts_with(const std::vector<std::string>& input, const std::string& startsWith) -: 26:{ 17: 27: std::vector<std::string> output; 17: 28: std::remove_copy_if(input.begin(), input.end(), std::back_inserter(output), !boost::bind(&boost::starts_with<std::string,std::string>, _1, startsWith)); #####: 29: return output; -: 30:} My

Code coverage with GCOV can't produce .gcda file

主宰稳场 提交于 2019-12-22 18:45:31
问题 I want to get code coverage with GCOV, I set build setting by http://developer.apple.com/library/mac/#qa/qa2007/qa1514.html add "-lgcov" to "Other Linker Flags" check "Instrument Program Flow" check "Generate Test Coverage Files" but I can't produce the .gcda file, could anyone help? 回答1: The simulator has to close before the gcda files get generated. So, when I run GHUnit I have to close this app first. There's also a setting in the plist to kill the app when it closes, rather than have it

Eclipse gcov missing highlighting in code

。_饼干妹妹 提交于 2019-12-22 10:12:00
问题 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

How does one get the actual function names from these output

99封情书 提交于 2019-12-22 04:33:17
问题 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

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

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

Is there a way to focus lcov code coverage reports to just one or two directories?

痴心易碎 提交于 2019-12-18 10:33:39
问题 I recently started using lcov to visualize my code coverage. It's a great tool. One thing I'm noticing is that it generates code coverage reports for all the files that I'm using - including those that I'm not interested in. For example, it will give me code coverage reports for boost and mysql++ files. Is there an easy way to force lcov to only generate coverage reports for specific files? I have tried using the -k parameter like so: /usr/bin/lcov -q -c -i -b . -d .obj -k src/ -k include/ -o

How to merge multiple versions of gcda files?

隐身守侯 提交于 2019-12-12 19:46:38
问题 I'm using gcov for get coverage information of my application. However, there are 3 instances of my applications are running concurrently creating 3 versions of "gcda" files. Is there a way to merge different versions of same "gcda" files in my coverage information file. I want to take the coverage information as just one instance. 回答1: I have just been looking into the same problem, and here is what I found. TL;DR yes it is possible, in best case by just being careful with compilation order,