PDA

View Full Version : QT and Gcov



MonkeyJLuffy
3rd May 2010, 17:04
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

mhoover
28th December 2010, 20:54
Sweet!

Dropped my %cpu from 40 to 35.

ommharidaas
2nd March 2012, 10:28
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!