Results 1 to 3 of 3

Thread: QtTest: Unittesting in several classes

  1. #1
    Join Date
    Feb 2006
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QtTest: Unittesting in several classes

    Hello,

    is there a way to declare multiple classes as Qt testclasses? Atm I have to write all unittests in one class, this doesn't scale very vell imo..
    Any other way to use more classes?

    Thanks for answer

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtTest: Unittesting in several classes

    Sure you can. Just don't use QTEST_MAIN() but instead call all test objects one by one yourself. You can check what QTEST_MAIN expands to to provide your own implementation of the main() function.

  3. #3
    Join Date
    Aug 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QtTest: Unittesting in several classes

    Yes, you can exec each class directly but I find that can be a mission.
    Perhaps if you want exact control of the execution order that may be the way to go but unit tests should be standalone anyways so execution order should not be that important.

    Instead try qttestutil:
    http://el-tramo.be/blog/qttestutil

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.