Results 1 to 3 of 3

Thread: QT and Gcov

  1. #1
    Join Date
    Apr 2010
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QT and Gcov

    Hello everybody,

    First, I work on RedHat Linux machine with the eclipse CDT

    I'm trying to use the covering code tool Gcov, in order to test my application, but I couldn't arrive to get all the files necesary to compute my test.

    I give you my .pro file :

    TEMPLATE = app
    TARGET = GFT
    QT += core \
    network
    HEADERS += [ one file ] \
    [ lot of files ]
    SOURCES += [ one file ] \
    [ lot of files ]
    FORMS +=
    RESOURCES +=
    INCLUDEPATH += $$(BASE_DIR)
    DEPENDPATH += $$(BASE_DIR)
    QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
    QMAKE_LDFLAGS += -fprofile-arcs -ftest-coverage
    LIBS += -lgcov
    When I compile in debug mode, I obtain in the debug directory this files : *.cpp *.o *.gcno

    I let you also my "guide" that they give me, in order to compute the test

    a) Resetting counters
    lcov -d debug -b . -z

    b) Capturing the current coverage state to a file (works only after the
    application has been started and stopped at least once)

    lcov -d debug -b . -c -o app.info
    lcov -r app.info '/usr/include/c++/*' '/usr/local/Trolltech/Qt-4.5.3*' '*moc_*cpp' -o result.info

    c) Getting HTML output
    genhtml -o doc/coverage -t "TEST SCET-M" --legend --no-function-coverage result.info
    All that I know is, that normaly, I shoul have some .da files, but it look like I don't have them.

    Someone have any idea to use correctly Gcov with Qt ?
    It miss any options ?
    It miss any step ?

    Thank's a lot

    Luffy

  2. #2
    Join Date
    Jan 2006
    Location
    Maui, Hawaii
    Posts
    120
    Thanks
    65
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT and Gcov

    Sweet!

    Dropped my %cpu from 40 to 35.
    Last edited by mhoover; 28th December 2010 at 20:55. Reason: goof

  3. #3
    Join Date
    Jul 2011
    Location
    Pune, India
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and Gcov


    Hi all,
    I understand that this is a pretty old thread.
    I am new all this 'Code Coverage' thing. . . . . . .
    can anyone help me understand how to setup the environment to use gcov?
    what all things needs to be done!

Similar Threads

  1. Gcov with Qt
    By maninc in forum General Programming
    Replies: 7
    Last Post: 5th May 2009, 14:01
  2. qmake and gcov?
    By akos.maroy in forum General Programming
    Replies: 1
    Last Post: 15th August 2008, 15:00

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.