gcov is not generating coverage information for header files

后端 未结 3 1850
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 14:19

I\'m using gcov for the first time and I\'m having a problem which is similar to the one reported in this thread. However, I wasn\'t able to solve my problem following the comme

3条回答
  •  悲&欢浪女
    2021-01-21 14:41

    Thank you very much Tony!! That link had the solution. I just changed the optimization from -O2 to -O0 and now the result is:

    1: 192: const QString& institutionId(void) const { 
    1: 193:     return m_institution; 
    -: 194: } 
    

    I have to note that to obtain "mymoneyaccount.cpp.gcov" I execute "gcov mymoneyaccount.cpp", but to obtain "mymoneyaccount.h.gcov" I have to execute "gcov mymoneyaccounttest.cpp". Do you know why? Both files include "mymoneyaccount.h".

提交回复
热议问题