I want to start using the Google C++ Testing Framework, but I don't understand how it use with Qt?
What should I do to start? How to link GTF to my project and use it? If possible, I'd like a detailed guide.
There is nothing special about testing Qt in particular, just familiarize yourself with google testing and Qt, then write your test cases. You'd test Qt code like you'd test anything else.
Good places to start:
The one thing to keep in mind is that a significant part of Qt is event driven, which requires a running event loop.
Additional resources:
Edit:
To elaborate on Gluttton's comment, as evidently, other users share the sentiment:
The clarification about the design particularities of Qt should imply two things:
1 - in many cases, individual tests will require an above trivial setup, that is still standard Qt and C++, set up event loops and connections and whatnot - nothing special whatsoever.
2 - in some cases, there is only so much that unit testing can do. Some functionality requires larger and more complicated runtime setups, that are impractical or even impossible in the context of unit testing, thus falling outside of the scope of the google testing framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With