Results 1 to 7 of 7

Thread: QtTest - use it in your application

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QtTest - use it in your application

    You can just create a seciton in you .pro file, something like this:
    Qt Code:
    1. // project.pro
    2.  
    3. // some regular stuff
    4. INCLUDEPATH += ...
    5. SOURCES += ..
    6. // etc
    7.  
    8. // here for testing
    9. test_conf{
    10. TARGET = my_app_test # different app name for testing suite
    11. QT += testlib
    12. SOURCES += test.cpp test2.cpp
    13. HEADERS += test.h ...
    14. ... other stuff for tests
    15. }
    To copy to clipboard, switch view to plain text mode 
    Then you can generate makefiles for test with qmake:
    Qt Code:
    1. qmake -config test_conf
    To copy to clipboard, switch view to plain text mode 
    After that, simply build the project as usual. Instead of your regular target, a my_app_test.exe will be created, using your test sources.

  2. The following user says thank you to stampede for this useful post:

    migel (20th December 2011)

Similar Threads

  1. qttest output
    By BalaQT in forum Qt Programming
    Replies: 3
    Last Post: 28th May 2011, 17:17
  2. QtTest and asserts
    By doberkofler in forum Qt Programming
    Replies: 11
    Last Post: 21st September 2010, 07:22
  3. QTTest and my own gui
    By GrahamLabdon in forum Newbie
    Replies: 0
    Last Post: 19th March 2010, 10:26
  4. QtTest example not compiling
    By GrahamLabdon in forum Newbie
    Replies: 3
    Last Post: 19th March 2010, 09:41
  5. QtTest bug
    By graeme in forum Qt Programming
    Replies: 4
    Last Post: 19th February 2006, 21:16

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
  •  
Qt is a trademark of The Qt Company.