Using gcov


 
Thread Tools Search this Thread
Top Forums Programming Using gcov
# 1  
Old 09-14-2010
Using gcov

Hi,

I am using gcov to get code coverage for my program written in C++, I am able to do it without any problem when i don't have a directory structure, for my program I am a directory structure as below
Code:
./src/ -- containing all my source files

./obj/ -- containing all my object files

./header/ -- containing all my header files

../../lib/  -- containing a static library, which will be used by 
                my program 

there is a makefile in the current directory which creates my executable

Quote:
do i need to compile the static library also with the options of gcov i.e. -fprofile-arcs -ftest-coverage, because it is the library that i need to check for coverage.

Kindly help on how use gcov in this situation.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need script to remove GCOV flags from Qt project file

Hi, I have the following gcov compilation flags in all the QT source code project (*.pro) files. CONFIG(gcov) { LIBS += -lgcov QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage } Now, I want to remove these flags off my files. Please help me with a script to... (1 Reply)
Discussion started by: royalibrahim
1 Replies

2. Shell Programming and Scripting

Bash removing sysmacros.h from GCOV

Hey. GCC GCOV now outputs a file called sysmacros.h as part of its results. How can I remove it from the html? The tags looks like this: <tr bgcolor="e0f0d0"> <td bgcolor="dae7fe" style="padding-top: 3px; padding-left: 30px; padding-bottom: 3px; padding-right: 30px;">... (3 Replies)
Discussion started by: rpowell86
3 Replies

3. Linux

GCOV : struct bb

Hi, I am working on gcov.Meaning, analysing the functionality of gcov. There is one structure called "struct bb". I am not sure, how struct bb members are getting assigned values. If anyone knows how it is happening pls let me know. Thanks in advance. --Vichu (0 Replies)
Discussion started by: Vichu
0 Replies

4. Debian

Application link error with gcov

Hi, I'm trying gcov on my Debian VM. gcov (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) Copyright (C) 2006 Free Software Foundation, Inc. It work with example program, but I got link error in my application code. C_FLAGS += -Wall -W -O0 -fprofile-arcs -ftest-coverage Each class... (1 Reply)
Discussion started by: clho
1 Replies
Login or Register to Ask a Question
COVER(1p)						User Contributed Perl Documentation						 COVER(1p)

NAME
cover - report coverage statistics VERSION
version 0.89 SYNOPSIS
cover -help -info -version -summary -report report_format -outputdir dir -select filename -ignore filename -select_re RE -ignore_re RE -write [db] -delete -dump_db -launch -silent -coverage criterion -test -gcov -make [make] -add_uncoverable_point -delete_uncoverable_point -clean_uncoverable_points -uncoverable_file [report specific options] coverage_database [coverage_database ...] DESCRIPTION
Report coverage statistics in a variety of formats. The summary option produces a short textual summary. Other reports are available by using the report option. The following reports are currently available: text - detailed textual summary html - detailed HTML reports OPTIONS
The following command line options are supported: -h -help - show help -i -info - show documentation -v -version - show version -silent - don't print informational messages (default off) -summary - give summary report (default on) -report report_format - report format (default html) -outputdir - directory for output (default db) -launch - launch report in viewer (if avail) (default off) -select filename - only report on the file (default all) -ignore filename - don't report on the file (default none) -select_re RE - append to REs of files to select (default none) -ignore_re RE - append to REs of files to ignore (default none) -write [db] - write the merged database (default off) -delete - drop database(s) (default off) -dump_db - dump database(s) (for debugging) (default off) -coverage criterion - report on criterion (default all available) -test - drop database(s) and run make test (default off) -gcov - run gcov to cover XS code (default on if using gcc) -make make_prog - use the given 'make' program for 'make test' other options specific to the report format REPORT FORMATS
Tool accepts -report option: html|html_minimal (default) HTML reporting. Percentage thresholds are color-coded and configurable via -report_c0 <integer>, -report_c1 <integer> and -report_c2 <integer>.: 0% 75% 90% 100% | .. | .. | .. | <c0 <c1 <c2 c3 red yellow orange green html_basic HTML reporting with syntax highlighting if PPI::HTML or Perl::Tidy module is detected. Like html|html_minimal reporting, percentage thresholds are color-coded and configurable. text Plain text reporting. compilation Like text but hacked to give a minimal output in a format similar to that output by Perl itself so that it's easier to step through the untested locations with Emacs compilation mode. DETAILS
Any number of coverage databases may be specified on the command line. These databases will be merged and the reports will be based on the merged information. If no databases are specified the default database (cover_db) will be used. The -write option will write out the merged database. If no name is given for the new database, the first database read in will be overwritten. When this option is used no reports are generated by default. Specify -select and -ignore options to report on specific files. Specify -coverage options to report on specific criteria. By default all available information on all criteria in all files will be reported. Available coverage options are statement, branch, condition, subroutine, and pod. However, if you know you only want coverage information for certain criteria it is better to only collect data for those criteria in the first place by specifying them at that point. This will make the data collection and reporting processes faster and less memory intensive. See the documentation for Devel::Cover for more information. The -test option will delete the databases and run your tests to generate new coverage data before reporting on it. Devel::Cover knows how to work with standard Perl Makefiles as well as Module::Build based distributions. For detailed instructions see the documentation for ExtUtils::MakeMaker at https://metacpan.org/module/ExtUtils::MakeMaker or for Module::Build at https://metacpan.org/module/Module::Build both of which come as standard in recent Perl distributions. The -gcov option will try to run gcov on any XS code. This requires that you are using gcc of course. If you are using the -test option will be turned on by default. EXIT STATUS
The following exit values are returned: 0 All operations were completed successfully. >0 An error occurred. SEE ALSO
Devel::Cover BUGS
Did I mention that this is alpha code? See the BUGS file. LICENCE
Copyright 2001-2012, Paul Johnson (paul@pjcj.net) This software is free. It is licensed under the same terms as Perl itself. The latest version of this software should be available from my homepage: http://www.pjcj.net perl v5.14.2 2012-06-15 COVER(1p)