Results 1 to 4 of 4

Thread: Can’t debug qtest unit tests (but can build and run them without issue)

  1. #1
    Join Date
    Nov 2010
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Can’t debug qtest unit tests (but can build and run them without issue)

    I’m having a problem trying to debug qtestlib tests. I can build and run the tests just fine and they output appropriate results. However I can’t actually seem to step through the tests to debug them. Despite not being able to find any posts on the issue in this forum or any others hopefully someone has run into such a thing before or at least has an idea of what may be wrong.

    If I try and debug (step into) the tests I get a message saying “Debugging information for ‘my_project_tests.exe’ cannot be found or does not match. Cannot find or open the PDB file.” And it asks me if I want to continue debugging. If I click yes then take a look at the modules window I see that, sure enough, the line my_project_tests.exe has a symbol status of “Cannot find or open the PDB file.” The only other modules that have anything other than symbols_loaded are the following:

    wxvault.dll has the message “Binary was not built with debug information”
    detoured.dll has the message “Cannot find or open the PDB file”
    sophos_detoured.dll (the antivirus we use) has the message “Cannot find or open the PDB file”

    If I then right-click on my_project_tests.exe and say load symbols from symbols path and select my_project_tests.pdb (and I’m sure it is the pdb that was built with the project, did a clean build to verify) Visual Studio gives me an error dialog saying “A matching symbol file was not found in this folder.” and it clears the entry.

    In terms of project settings I believe this project was created in VS by saying new project->Qt4 Projects->Qt Console Application then selecting GUI and Test library as additional modules.

    Here’s a list of possible applicable project settings:
    Qt is version 4.7.0 and I’m using VS2010 with the Qt plugin.
    Debug information format is Program Database (/Zi)
    Optimization is disabled
    Runtime library is set to Multi-threaded Debug
    Additional Dependencies include:
    qtmaind.lib
    QtCored4.lib
    QtGuid4.lib
    QtTestd4.lib
    my_project.lib
    Generate Debug Info in Yes

    If there are any other settings or other information that would be helpful please let me know.

    Thanks for your help. I’ve run into missing symbols before of course but this one is proving more difficult than normal…

  2. #2
    Join Date
    Nov 2010
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can’t debug qtest unit tests (but can build and run them without issue)

    If no one has any ideas what may be wrong can someone at least verify that they are able to debug Qt unit tests using Qt 4.7 and Visual Studio 2010 so I can verify that it’s just my problem?

  3. #3
    Join Date
    Apr 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can’t debug qtest unit tests (but can build and run them without issue)


    I also can't debug unit tests under Linux Ubuntu x64. I use QtCreator and the simpliest default unit tests project. I can run tests only from console (not from Qt Creator) under Qt creator I receive empty console without any information and therefor I cant debug its seems like app don't start. Can anyone test this issue under linux? Thanks in advice.

    edit:
    I must add that debug works fine for me this appear only under unit testing

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Can’t debug qtest unit tests (but can build and run them without issue)

    In Qt Creator make sure you are using a suitable console program (Tools menu, Options, Environment, General tab). For example, the default "xterm -e" works fine for me but "konsole -e" does not. Alternatively turn off the "Run in Console" option on the test run configuration and the output will appear in the Output Pane.

Similar Threads

  1. unit test focus behavior with QTest
    By bob_smith in forum Qt Programming
    Replies: 7
    Last Post: 19th August 2015, 20:21
  2. Qt + Linux + Eclipse - debug using debug build?
    By will49 in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2012, 06:27
  3. Unit tests
    By leoalvesmachado in forum Newbie
    Replies: 1
    Last Post: 13th April 2010, 20:50
  4. DEBUG macro not defined in debug build using vc++
    By piotr.dobrogost in forum Qt Programming
    Replies: 0
    Last Post: 21st July 2009, 13:07
  5. QTest Unit Testing
    By bothapn in forum Qt Programming
    Replies: 1
    Last Post: 16th July 2006, 22:11

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.