Results 1 to 2 of 2

Thread: Unit Test Organisation, and having qmake what I want

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

    Default Unit Test Organisation, and having qmake what I want

    Hi,

    I'm working on a qt project called xdc. Its source tree looks like this:

    Qt Code:
    1. /
    2. xdc.pro
    3. xdc/
    4. include/
    5. ...
    6. src/
    7. ...
    8. test/
    9. include/
    10. ...
    11. src/
    12. ...
    To copy to clipboard, switch view to plain text mode 

    Now, I want to write a project file so that after generating the Makefile, I should be able to compile the test cases simply with a "make test" command.

    What should I write in xdc.pro to make it possible?

    More generally, how are unit tests organized in a qt project? Is there a specific way to do it?

    Thanks

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Unit Test Organisation, and having qmake what I want

    i am not sure if it is the best solution but should work:
    1. make some pro file for building tests and put it in test/ dir (lets say tests.pro)
    2. add to xdc.pro something like this:
    Qt Code:
    1. mytests.target = test
    2. mytests.commands = cd test && qmake && make
    3. QMAKE_EXTRA_TARGETS += mytests
    To copy to clipboard, switch view to plain text mode 
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

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.