Re: Measuring test coverage of GSL with GCOV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



.gcda and .gcno files for the library are generated in directory where the
.o files of the library were generated. You need to go to that directory
and play gcov with the data files and source files. Simply search *.gcda
may give you results.

--Junchao Zhang


On Thu, May 9, 2019 at 3:23 PM Z. <zell08v@xxxxxxxxx> wrote:

> Hello,
>
> I want to use GCOV to measure how many statement/functions of GNU
> Scientific Library (GSL) have been reached by a user-defined program.
>
> The user-defined program is an example from GSL’s manual:
>
> https://www.gnu.org/software/gsl/manual/html_node/Example-statistical-programs.html
> .
> Something llke
>
> *#include <stdio.h> *
> *#include <gsl/gsl_statistics.h> *
>
> *int *
> *main(void) *
> *{ *
> *  double data[5] = {17.2, 18.1, 16.5, 18.3, 12.6}; *
> *... *
> *  smallest = gsl_stats_min(data, 1, 5); *
> *… *
> *return 0; *
> *} *
>
> First,  I compiled GSL with relevant flags:  ./configure
> CFLAGS="-fprofile-arcs -ftest-coverage -g -O0”
>
> Then, I compiled and linked the example program to GSL: gcc -fprofile-arcs
> -ftest-coverage -g -O0 example.c -lgsl -lgslcblas -lm
>
> At last I ran the example program: LD_LIBRARY_PATH=/usr/local/lib ./a.out
>
> But, I could only see example.gcov, namely, only coverage info for the
> example seems to be  produced.  Where did it go wrong? How can I also get
> coverage for the code in GSL part?
>
> Thanks.
>
> Zhoulai
>




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux