Results 1 to 2 of 2

Thread: qmake and gcov?

  1. #1
    Join Date
    Jun 2008
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question qmake and gcov?

    I wonder if anyone has set up a gcov code coverage analysis setup using qmake. I'd be interested in the details

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qmake and gcov?

    This is a bit hackish but works
    Qt Code:
    1. ######################################################################
    2. # make coverage (debug)
    3. ######################################################################
    4.  
    5. coverage.CONFIG += recursive
    6. QMAKE_EXTRA_TARGETS += coverage
    7.  
    8. CONFIG(debug,debug|release) {
    9.  
    10. QMAKE_EXTRA_TARGETS += cov_cxxflags cov_lflags
    11.  
    12. cov_cxxflags.target = coverage
    13. cov_cxxflags.depends = CXXFLAGS += -fprofile-arcs -ftest-coverage
    14.  
    15. cov_lflags.target = coverage
    16. cov_lflags.depends = LFLAGS += -fprofile-arcs -ftest-coverage
    17.  
    18. coverage.commands = @echo "Built with coverage support..."
    19. build_pass|!debug_and_release:coverage.depends = all
    20.  
    21. QMAKE_CLEAN += $(OBJECTS_DIR)/*.gcda $(OBJECTS_DIR)/*.gcno
    22. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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.