gcov

What is the branch in the destructor reported by gcov?

狂风中的少年 提交于 2019-11-27 11:19:57
When I use gcov to measure test coverage of C++ code it reports branches in destructors. struct Foo { virtual ~Foo() { } }; int main (int argc, char* argv[]) { Foo f; } When I run gcov with branch probabilities enabled (-b) I get the following output. $ gcov /home/epronk/src/lcov-1.9/example/example.gcda -o /home/epronk/src/lcov-1.9/example -b File 'example.cpp' Lines executed:100.00% of 6 Branches executed:100.00% of 2 Taken at least once:50.00% of 2 Calls executed:40.00% of 5 example.cpp:creating 'example.cpp.gcov' The part that bothers me is the "Taken at least once:50.00% of 2". The

Where are the gcov symbols?

若如初见. 提交于 2019-11-27 09:23:24
问题 I'm trying to compile a simple app with gcov and getting the following link errors: gcc AllTests.o CuTestTest.o CuTest.o -o TestTest AllTests.o: In function `global constructors keyed to 0_RunAllTests': /home/p7539c/cutest/AllTests.c:26: undefined reference to `__gcov_init' AllTests.o:(.data+0x44): undefined reference to `__gcov_merge_add' CuTestTest.o: In function `global constructors keyed to 0_TestCuStringNew': /home/p7539c/cutest/CuTestTest.c:30: undefined reference to `__gcov_init'

With gcov, is it possible to merge to .gcda files?

断了今生、忘了曾经 提交于 2019-11-27 02:47:28
问题 I have the same source files (C and Obj-C) being compiled into two targets: the unit test executable and the actual product (which then gets integration tested). The two targets build into different places, so the object files, .gcno and .gcda files are separate. Not all source files are compiled into the unit test, so not all objects will exist there. All source files are compiled into the product build. Is there a way to combine the two sets of .gcda files to get the total coverage for unit

LCOV/GCOV branch coverage with C++ producing branches all over the place

喜欢而已 提交于 2019-11-26 19:41:50
问题 We are using LCOV/GCOV to produce test coverage of our projects. Recently we tried to enable branch-coverage additionally. But it looks like, this just doesn't yield the results we expected from a high-level developer view. Using branch-coverage with C++ blows the report up with branches all over the place. We suspect (as the searching for the issues indicates) that mostly exception handling code creates these "hidden branches". And GCOV/LCOV doesn't seem to skip over these. I created a small

What is the branch in the destructor reported by gcov?

笑着哭i 提交于 2019-11-26 15:32:21
问题 When I use gcov to measure test coverage of C++ code it reports branches in destructors. struct Foo { virtual ~Foo() { } }; int main (int argc, char* argv[]) { Foo f; } When I run gcov with branch probabilities enabled (-b) I get the following output. $ gcov /home/epronk/src/lcov-1.9/example/example.gcda -o /home/epronk/src/lcov-1.9/example -b File 'example.cpp' Lines executed:100.00% of 6 Branches executed:100.00% of 2 Taken at least once:50.00% of 2 Calls executed:40.00% of 5 example.cpp