<table><tr><td style="">qi437103 created this revision.<br />qi437103 added a reviewer: apol.<br />Restricted Application added a subscriber: kdevelop-devel.</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D1985" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This is a side effect of my work on lldb plugin unit tests, in which I tried to fix the somewhat unreliable test results.</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Move unit test debugees to common folder, make gdb uses common unit test helpers</li>
<li class="remarkup-list-item">Make gdb plugin unit tests more reliable. waitForState now guarantees the session state after returning is exactly the requested one (otherwise fails the test).</li>
</ul>

<p>The main problem is that DebugSession could end and get deleted when running event loop (i.e. in QTest::qWait).<br />
And this fix adds proper checks to it. This by itself doesn't fix any tests, but it helps when some tests<br />
did goes wrong. Without this fix, they could crash the whole test process due to accessing to deleted object.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>gdb plugin unit tests (and actually some lldb plugin unit tests, which is only on local yet)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKDEVELOP KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>common-unittest</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D1985" rel="noreferrer">https://phabricator.kde.org/D1985</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>debuggers/CMakeLists.txt<br />
debuggers/common/CMakeLists.txt<br />
debuggers/common/unittest/debugees/CMakeLists.txt<br />
debuggers/common/unittest/debugees/debugee space.cpp<br />
debuggers/common/unittest/debugees/debugee.cpp<br />
debuggers/common/unittest/debugees/debugeecrash.cpp<br />
debuggers/common/unittest/debugees/debugeeexception.cpp<br />
debuggers/common/unittest/debugees/debugeemultilocbreakpoint.cpp<br />
debuggers/common/unittest/debugees/debugeemultiplebreakpoint.cpp<br />
debuggers/common/unittest/debugees/debugeeqt.cpp<br />
debuggers/common/unittest/debugees/debugeerecursion.cpp<br />
debuggers/common/unittest/debugees/debugeeslow.cpp<br />
debuggers/common/unittest/debugees/debugeethreads.cpp<br />
debuggers/common/unittest/debugees/path with space/CMakeLists.txt<br />
debuggers/common/unittest/debugees/path with space/spacedebugee.cpp<br />
debuggers/common/unittest/unittest.cpp<br />
debuggers/common/unittest/unittest.h<br />
debuggers/gdb/CMakeLists.txt<br />
debuggers/gdb/unittests/CMakeLists.txt<br />
debuggers/gdb/unittests/debugee space.cpp<br />
debuggers/gdb/unittests/debugee.cpp<br />
debuggers/gdb/unittests/debugeecrash.cpp<br />
debuggers/gdb/unittests/debugeeexception.cpp<br />
debuggers/gdb/unittests/debugeemultilocbreakpoint.cpp<br />
debuggers/gdb/unittests/debugeemultiplebreakpoint.cpp<br />
debuggers/gdb/unittests/debugeeqt.cpp<br />
debuggers/gdb/unittests/debugeerecursion.cpp<br />
debuggers/gdb/unittests/debugeeslow.cpp<br />
debuggers/gdb/unittests/debugeethreads.cpp<br />
debuggers/gdb/unittests/path with space/CMakeLists.txt<br />
debuggers/gdb/unittests/path with space/spacedebugee.cpp<br />
debuggers/gdb/unittests/test_gdb.cpp<br />
debuggers/gdb/unittests/test_gdb.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>qi437103, apol<br /><strong>Cc: </strong>kdevelop-devel<br /></div>