Results 1 to 2 of 2

Thread: Testing and debugging my library with Qt Creator

  1. #1
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Testing and debugging my library with Qt Creator

    Hi! I'm writing my library with Qt Creator using Qt classes. Qt Creator compiles and link it and I indicated in the makefile to place it in a target directory. Now it is time to test it, so I'm writing a small application (with GUI) that links to the library and tests the APIs. What I'm finding bothering though is that this way I'm missing a way to debug it using the debugging functionalities of Qt Creator.

    Moreover this way, any time I need to fix something I have to rebuild and to reinstall the library to have both the binary and the headers deployed in the correct situation.

    Is there a more comfortable way to test the application? Maybe I should create my test classes inside the same project and then change the makefile so that the output is no more an app but a lib? How do you do the testing?

    Thanks!

  2. #2
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Testing and debugging my library with Qt Creator

    For the moment I found a possible solution: I created a new directory which will contain my test tool. I created the classes I need inside there and I included the files in a .pri file. Then, in the main .pro file, I used a new config value to switch between the library and the test application. This way it should be simple to switch between the deploy of the lib and running the test tool. Something like this:

    Qt Code:
    1. CONFIG += MAKE_LIBRARY
    2.  
    3. !MAKE_LIBRARY {
    4. include(myTestTool/myTestTool.pri)
    5. TEMPLATE = app
    6. }
    7. else {
    8. TEMPLATE = lib
    9. QT -= gui
    10. }
    To copy to clipboard, switch view to plain text mode 

    But I suppose this is not the best possible idea. There should be something better. If anyone knows please share!

Similar Threads

  1. Replies: 2
    Last Post: 19th February 2011, 11:26
  2. Creator/debugging
    By jhowland in forum Qt Programming
    Replies: 1
    Last Post: 21st October 2010, 09:16
  3. Debugging helper library
    By codeman in forum Qt Tools
    Replies: 0
    Last Post: 22nd March 2010, 13:03
  4. Debugging in QT Creator
    By cae in forum Qt Tools
    Replies: 6
    Last Post: 16th November 2009, 12:45
  5. debugging in QT Creator
    By talk2amulya in forum Qt Tools
    Replies: 3
    Last Post: 22nd February 2009, 06:50

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.