Ok! I try to write some automated tests "positive use cases" of my application. And it almost works (I have problem with main menu simulated clicks, but probably it is not related to whole "positive use cases" tests concept). I do it as follow:
1. Write test object - it should create QApplication (or its descendant) in initTestCase() and delete them in cleanupTestCase(), other slots should perform tests (as usual in QTestLib)
1. Detect "--demo" parameter in main(), and remove it from parameters list (or create QStringList with all parameters except "--demo") to avoid fatal error in QTest::qExec
2. Create in main() test object (e.g. called lTest)
3. Call in main(): return QTest::qExec(&lTest, lParams); In that case lParams is mentioned QStringList with main() parameters (except "--demo") converted from plain asci to QString.
Bookmarks