Results 1 to 2 of 2

Thread: QTestlib useability question

  1. #1
    Join Date
    May 2011
    Posts
    20
    Thanked 3 Times in 3 Posts
    Platforms
    Unix/X11

    Default QTestlib useability question

    I would like to write some automated tests for an application and would like to use QTestlib but I am confused on how I actually should go about doing it.

    From what I read I will have a separate application for each test. What I am confused about is how does the test application know anything about my GUI application? Do I have to instantiate the GUI within the test application and then reference the GUI instance in my test app? This would be unfortunate as every test I run would launch my application.

    What if I only want to test a specific dialog that appears in my GUI? I was hoping that I could just launch my GUI application, bring up the dialog and then kick off the test application. However the test application would have no way of accessing the dialog since they are 2 separate executables.

    All the examples I see create a widget in the test application and then runs the test off the created widget. It seems like it would be very difficult to use with a multi-dialog application as some of the dialog information may not be accessible as it is private/protected. It seems QTestLib is more geared towards testing individual widgets and not an entire application.

  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: QTestlib useability question

    QTestLib is a way to do unit tests. It's not very useful for testing the whole application. If you want to test a specific dialog, then you write a unit test that creates an instance of the dialog and you call methods of that dialog and see if you get expected results. Testing multiple dialogs with QTestLib doesn't make much sense, as it's not unit testing anymore but rather integration testing or even system testing.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to get the STDOUT from a QTestLib DLL?
    By entonjackson in forum Qt Programming
    Replies: 6
    Last Post: 19th October 2011, 09:02
  2. QTestlib problem
    By asinghma in forum Newbie
    Replies: 0
    Last Post: 25th October 2010, 10:56
  3. QTestlib - How to add own types
    By AlGaN in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2010, 19:22
  4. qtestlib
    By Jordan in forum Qt Programming
    Replies: 7
    Last Post: 28th September 2010, 11:47
  5. testing with QTestLib
    By hyling in forum Qt Programming
    Replies: 2
    Last Post: 12th July 2007, 20:37

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.