首页 > 解决方案 > How use QT Creator and Squish COCO

问题描述

I'm writing unit tests, but I would like to visualize the test coverage, my project is in QT, I have read a lo,t but I don't understand how to apply it to my code!! What are the specific steps? Could you send and code example?

标签: qttestingautomated-testscode-coverage

解决方案


You won't have to necessarily modify much of your code. The coverage will be measured once you have enabled the "instrumentation" of your project. The necessary steps are documented specifically for Qt Creator projects or more generically for QMake projects.

In case you are using Qt unit test framework you may want to look at the documented QTestLib integration. It will give you coverage numbers for each individual test case. That helps with latter analysis.


推荐阅读