Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. code coverage using GCOV in QtTest

code coverage using GCOV in QtTest

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shravan_121
    wrote on last edited by
    #1

    I need to have GCov code coverage in my qt testing and I made .pri file for testing project which contains the path of the test.cpp file and I have written the following in test.pro file:

    QMAKE_CXXFLAGS += --coverage
    QMAKE_LFLAGS += --coverage
    LIBS += -lgcov
    include(C:\Users\shraks\Documents\caltest\caltest.pri)

    Everything works fine but the gcov file is not created.Am I missing something or need to make some changes please suggest me.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      See https://medium.com/@kelvin_sp/generating-code-coverage-with-qt-5-and-gcov-on-mac-os-4999857f4676

      I disagree with their implementation of the test's main but it's not the point here

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      3
      • S Offline
        S Offline
        shravan_121
        wrote on last edited by
        #3

        I am using windows OS and i have just added the above code in qt i dont know how to create .GCNO files and get the coverage report.can you please share me the procedure to properly generate the code coverage report or file

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved