I've seen a variety of workarounds posted in various places that suggest writing custom main
functions instead of relying on the Qt QTEST_MAIN()
macro when creating a single test execution that works through many different tests of different classes.
Correct me if I'm wrong, but couldn't you just have a single test class and have as many slots as you need to test as many classes as you want? Just instantiate the desired class you want to test inside the slot's implementation and run your tests in that slot. Then, a different slot might instantiate a different class and run different tests. The single QTEST_MAIN
is supposed to run through all your slot tests, so everything gets tested, right?
Here are some of the alternate techniques I've read about that don't use QTEST_MAIN
: