Improve gdb plugin unit tests

Authored by qi437103 on Jul 10 2016, 5:41 PM.

Description

Improve gdb plugin unit tests

Summary:
This is a side effect of my work on lldb plugin unit tests, in which I tried to fix the somewhat unreliable test results.

  • Move unit test debugees to common folder, make gdb uses common unit test helpers
  • Make gdb plugin unit tests more reliable. waitForState now guarantees the session state after returning is exactly the requested one (otherwise fails the test).

The main problem is that DebugSession could end and get deleted when running event loop (i.e. in QTest::qWait).
And this fix adds proper checks to it. This by itself doesn't fix any tests, but it helps when some tests
did goes wrong. Without this fix, they could crash the whole test process due to accessing to deleted object.

Test Plan: gdb plugin unit tests (and actually some lldb plugin unit tests, which is only on local yet)

Reviewers: KDevelop, apol, kfunk

Reviewed By: KDevelop, apol, kfunk

Subscribers: kfunk, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D1985

Details

Committed
qi437103Jul 15 2016, 5:32 PM
Reviewer
KDevelop
Differential Revision
D1985: Improve gdb plugin unit tests
Parents
R32:6d7a4cfed42b: Cleanup MIDebugger output signals
Branches
Unknown
Tags
Unknown