Tuesday, June 10, 2014

Code coverity using GCC gcov



Create a cpp source file with main function and name it main.cpp

Build source with gcov enabled
g++ -Wall -fprofile-arcs -ftest-coverage main.cpp
                It will generate main.gcno file
Run binary
                ./a.out
                It will generate main.gcda file
Run gcov for the source file
                gcov main.cpp
                it will generate main.cpp.gcov file
Open main.cpp.gcov and analyse ##### lines for un tested code lines.

6 comments:

  1. This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again.

    Hadoop Training in Chennai

    ReplyDelete
  2. These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful and knowledgeable information.

    Eczema Treatment
    Psoriasis Oil
    Hyperpigmentation Treatment
    Herbal Tonic

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Great articles, first of all Thanks for writing such lovely Post! Earlier I thought that posts are the only most important thing on any blog. But here at Shoutmeloud I found how important other elements are for your blog.Keep update more posts..
    Journal Of Materials Science
    International Journal Of Scientific Research
    International Journal Of Current Research
    International Journal Of Research
    International Journal

    ReplyDelete