[Snort-devel] Configure Snort with --enable-test-coverage

Victor Roemer viroemer at cisco.com
Mon Jul 24 10:18:16 EDT 2017

did you run |gcov|?

For starters, I wouldn’t install the binary that I’m intending on doing 
coverage on- I’d just run snort out of the source tree.

Anyway, I just tested and I’m getting everything

|viroemer at piglatin:~/snort/src$ ./snort -V ,,_ -*> Snort! <*- o" )~ 
Version 2.9.11 GRE (Build 1051) '''' By Martin Roesch & The Snort Team: 
http://www.snort.org/contact#team Copyright (C) 2014-2016 Cisco and/or 
its affiliates. All rights reserved. Copyright (C) 1998-2013 Sourcefire, 
Inc., et al. Using libpcap version 1.7.4 Using PCRE version: 8.38 
2015-11-23 Using ZLIB version: 1.2.8 viroemer at piglatin:~/snort/src$ gcov 
snort File 'snort.c' Lines executed:30.11% of 1913 Creating 
'snort.c.gcov' File 'reload.h' Lines executed:0.00% of 28 Creating 
'reload.h.gcov' File 'active.h' Lines executed:14.29% of 21 Creating 
'active.h.gcov' File 'snort.h' Lines executed:59.09% of 66 Creating 
'snort.h.gcov' File 'sfutil/sfPolicyData.h' Lines executed:0.00% of 10 
Creating 'sfPolicyData.h.gcov' File '../src/sfutil/sfPolicyUserData.h' 
Lines executed:0.00% of 2 Creating 'sfPolicyUserData.h.gcov' File 
'../src/sfutil/sfPolicy.h' Lines executed:0.00% of 4 Creating 
'sfPolicy.h.gcov' File 'cpuclock.h' Lines executed:0.00% of 6 Creating 
'cpuclock.h.gcov' File '../src/preprocessors/perf.h' Lines 
executed:0.00% of 8 Creating 'perf.h.gcov' File 'encode.h' Lines 
executed:0.00% of 6 Creating 'encode.h.gcov' File 'util.h' Lines 
executed:37.50% of 16 Creating 'util.h.gcov' File 
'../src/sfutil/sf_ip.h' Lines executed:88.89% of 9 Creating 'sf_ip.h.gcov' |

On 7/24/17 10:09 AM, Gwendal Cournee wrote:

> I already tried to find "*.gcov" files using "find / -name "*.gcov". 
> It seems that no such files are created even with the configuration 
> from above. Maybe an option must be set when launching Snort after 
> this specific installation but I can not find it.
> 2017-07-24 16:02 GMT+02:00 Victor Roemer <viroemer at cisco.com 
> <mailto:viroemer at cisco.com>>:
>     I would think it would dump the output in your current directory..
>     but I’m no expert in gcov.
>     You could |updatedb| and |locate gcov| or just |cd /; find . -name
>     "*.gcov"|
>     On 7/24/17 9:42 AM, Gwendal Cournee via Snort-devel wrote:
>>     To whom it may concern,
>>     I would like to do a code coverage with gcov of Snort (I am
>>     testing it with a program), so I configured it with the following
>>     line :
>>     ./configure --enable-test-coverage --enable-debug
>>     In the makefile, CFLAGS does include '-fprofile-arcs
>>     -ftest-coverage', which is required to make gcov works.
>>     However, installation then works fine, but i can not find or
>>     understand where the output file is (the .gcov files).
>>     How can I use gcov with Snort ?
>>     Any help would be appreciated,
>>     Gwendal Cournée
>>     _______________________________________________
>>     Snort-devel mailing list
>>     Snort-devel at lists.snort.org <mailto:Snort-devel at lists.snort.org>
>>     https://lists.snort.org/mailman/listinfo/snort-devel
>>     <https://lists.snort.org/mailman/listinfo/snort-devel>
>>     Please visithttp://blog.snort.org  for the latest news about Snort!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20170724/cf87e82b/attachment.html>

More information about the Snort-devel mailing list