I started using QtTest for my application and very quickly began to run into limitations. Two main problems:
1) My tests run very quickly - fast enough that the overhead of downloading the executable file, setting up the Q (Core) application (if necessary), etc. often outshine the running time of the tests themselves! Linking each executable takes a lot of time.
The overhead simply increased as more and more classes were added, and soon it became a problem - one of the goals of unit tests was to have a safety net that worked so fast that it wasn’t a burden, and it quickly didn’t. The solution is to combine several test suites into one executable file, and while (as shown above) this basically does not work, is not supported, and has important limitations.
2) Lack of hardware support is a deal breaker for me.
So, after a while I switched to Google Test - it is a much more functional and complex unit testing system (especially when used with Google Mock) and solves 1) and 2), and in addition, you can still easily use the convenient QTestLib functions such as QSignalSpy and GUI simulation, etc. It was a little painful to switch, but, fortunately, the project did not go too far, and many of these changes can be automated.
Personally, I will not use QtTest over Google Test for future projects - unless it offers the real advantages that I see, and has important disadvantages.
SSJ_GZ 02 Oct 2018-12-12T00: 00Z
source share