Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Linux Tools Project » gcov plug-in with eclipse(How to use gcov plug-in)
gcov plug-in with eclipse [message #1010149] Sat, 16 February 2013 17:46 Go to next message
Mateus Mendelson Silva is currently offline Mateus Mendelson Silva
Messages: 1
Registered: February 2013
Junior Member
Hi everyone!

I'm new in this forum, so I am sorry if this is not the right place to ask this...

I have recently downloaded the gcov plug-in in my eclipse juno (my system: ubuntu 12.10 64 bits). All I want is to get the coverage of my test, but I just don't know how to do this... The plug-in is installed, and now? How do I use it?

I'd really appreciate if someone could help me!

Thanks!
Re: gcov plug-in with eclipse [message #1010427 is a reply to message #1010149] Sun, 17 February 2013 08:50 Go to previous messageGo to next message
Tamas Kleiber is currently offline Tamas Kleiber
Messages: 20
Registered: December 2010
Junior Member
You need a gprof/gcov enabled GCC generated executable. Read this tutorial. If you have the executable which was built with the proper settings you will get a set of .gcda and a .gcno files. You can double left click these files in your eclipse project explorer and get the coverage summary or annotated source code.



  • Note, that your operating system must be set up in a way that eclipse could find a copy of c++filt.exe and addr2line.exe. If you GCC is registered correctly on the system this will be OK.
  • Note that if possible you should use a recent GCC version as the gcov format changes often and the latest versions support switches like GCOV_PREFIX and GCOV_PREFIX_STRIP which are very useful.
  • Note that in your project settings, you must set up binary parsers correctly otherwise you might get an error message when you select the executable after double clicking the coverage data files. If you are on windows, select Win 32 PE executable as active parser. On linux, activate an elf parser and so on.
  • You should know that this plug-in is only capable of generating line coverage information while it is possible to get decision coverage with gcov itself too... you could check out lcov for further reference on the topic.
  • If possible, you should try one of the latest nightly builds as there are important bug fixes in the unreleased development snapshots.


Additionally read this.

[Updated on: Sun, 17 February 2013 09:06]

Report message to a moderator

Re: gcov plug-in with eclipse [message #1061356 is a reply to message #1010149] Fri, 31 May 2013 10:17 Go to previous messageGo to next message
Günther Makulik is currently offline Günther Makulik
Messages: 1
Registered: May 2013
Junior Member
Hi,

I have been following all instructions above and in the mentioned tutorial, but still get the following error when I start the gcov profiling:

An error has occurred when parsing the coverage data files:
'Missing function or duplicate counter tag'

I have tried this with the following environment(s):
- Eclipse CDT (Juno & Kepler)
- Suse Linux 12.2
- GCC 4.7
- Google Mock
- Google Test

Besides Google Mock and Google Tests I have loads of class templates in the code to cover.

BTW: I get the same error, no matter which of the produced .gcda/.gcno files is double clicked.

An Idea anyone?
Re: gcov plug-in with eclipse [message #1061509 is a reply to message #1061356] Sat, 01 June 2013 12:34 Go to previous messageGo to next message
Tamas Kleiber is currently offline Tamas Kleiber
Messages: 20
Registered: December 2010
Junior Member
I've created a bug report for this issue a few months ago which can be found here.

If anybody encounters this issue please add a comment to the bug report and I encourage everybody to vote up the bug so that it gets some attention from the developers! Thank you in advance for your kind support.
Re: gcov plug-in with eclipse [message #1061511 is a reply to message #1061356] Sat, 01 June 2013 12:40 Go to previous message
Tamas Kleiber is currently offline Tamas Kleiber
Messages: 20
Registered: December 2010
Junior Member
Günther,

until this issue gets fixed, you could try to use lcov. It requires very little setup and you could also filter out gtest's files from the HTML coverage report. Only perl and some shell commands are needed by the tool. On Linux everything should work right away. On windows, the tool works pretty well under mingw/msys.

Note that under windows one of the perl scripts could get in trouble with virtual ClearCase file systems due to the shell command, find. If you encounter this issue just modify the perl scripts' shell commands to use an alternative to "find".
Previous Topic:Eclipse Cygwin Codesourcery
Next Topic: C++ Unit Testing Framework
Goto Forum:
  


Current Time: Sat Oct 25 07:20:58 GMT 2014

Powered by FUDForum. Page generated in 0.02412 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software