Results 1 to 2 of 2

Thread: Project structure with qtestlib

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Project structure with qtestlib

    I have a project with many small classes which i would like to test, I'm using qmake and qtestlib.
    Reading qtestlib's manual I got the impression that the common way to test classes is to use the QTEST_MAIN() macro, which expands into a main function. This means i must create a project file for every class.

    How can I avoid creating so many project files just to test small classes?

    My possible solutions would be:
    - Covering different small classes in one test (But I'd prefer to keep classes separated)
    - Writing my own main function which in turns calls the others functions
    - Maybe reimplementing QTEST_MAIN to better suit my needs

    I'd really like to get advises about this... What would you do? How are your projects structured?

  2. #2
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Project structure with qtestlib

    I finally found a solution to this here:
    http://lists.trolltech.com/qt-intere...ad00129-0.html

    I removed all the QTEST_MAIN macro and I created a single file with a main function calling QTest::qExec() on all my test classes.

Similar Threads

  1. qmake project setup - qtestlib scenario
    By dsaiko in forum Qt Programming
    Replies: 1
    Last Post: 6th June 2011, 15:52
  2. Qtestlib unittests & Qmake
    By saulit in forum Newbie
    Replies: 0
    Last Post: 5th February 2009, 19:06
  3. Project structure with Qt designer
    By lmax in forum Newbie
    Replies: 1
    Last Post: 12th June 2008, 01:17
  4. testing with QTestLib
    By hyling in forum Qt Programming
    Replies: 2
    Last Post: 12th July 2007, 20:37
  5. GUI runner of QTestLib
    By Intaek Lim in forum Qt-based Software
    Replies: 1
    Last Post: 25th April 2007, 08:06

Tags for this Thread

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.