Search code examples
c++unit-testinggoogletestqtestlib

c++ unit-tests sample in open-source-project


I'm interested in learning about c++-unit-testing in the 'real-world'. I'd like to see a complex class with good test-coverage. Preferably tested with g-test or qtestlib. I had a look at KDE and Chromium but didn't find what I wanted.


Solution

  • Even if you have a proper knowledge of the gtest framework, in order to fully understand the test coverage you should first understand the project's needs and how it works.

    That said, clang has a good unit tests coverage and code generation tests which often use advanced mocking techniques.

    There's no silver bullet to your question since it's based on your personal experience and preferences.