Debug Qt application while running Squish GUI tests

Debug Qt application while running Squish GUI tests

Some issues with Application Under Tests (AUT) appear only when a test is executed with Squish. For some cases, it’s easier run our test scenario with Squish than repeating it manually. To get a detailed information about the state of our AUT during a test execution, you can attach to it with an external debugger (gdb/lldb).

How to do it?

      1. Put a breakpoint after startApplication/attachToApplication in the Squish IDE.
      2. Start a Test Case in the Squish IDE and wait until a breakpoint is reached.
      3. Attach gdb/lldb to the running process (gdb has an “attach PID” command or -p parameter during startup).
      4. Set a breakpoint in the debugger (break command) and resume (continue command) OR display a backtrace (bt command)
      5. Resume execution of a Test Case in Squish IDE.

      Another approach can be used when debugging AUT crashes. For that, we don’t need to attach to running application process. All analysis can be done a post-mortem. Detailed recipe can be found in How to get a backtrace on Unix with the bash or tcsh shell article.

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*