Commit 8daaa2f6 authored by Christian Stenger's avatar Christian Stenger

Debugger: Restructure cleaning up after test

If the test case would result in a failing test it does not
execute further commands.
Ensure to close possible open editors even for failed test runs.

Change-Id: Ifcdcb76de5d10f649d38b84dad8999c6fd491ade
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 3c63b621
......@@ -163,6 +163,8 @@
#include <cpptools/cpptoolstestcase.h>
#include <cpptools/projectinfo.h>
#include <utils/executeondestruction.h>
#include <QTest>
#include <QSignalSpy>
#include <QTestEventLoop>
......@@ -3675,6 +3677,9 @@ void DebuggerUnitTests::testStateMachine()
ProjectExplorerPlugin::buildProject(SessionManager::startupProject());
loop.exec();
ExecuteOnDestruction guard([] () {
EditorManager::closeAllEditors(false);
});
DebuggerRunParameters rp;
Target *t = SessionManager::startupProject()->activeTarget();
QVERIFY(t);
......@@ -3691,7 +3696,6 @@ void DebuggerUnitTests::testStateMachine()
});
QTestEventLoop::instance().enterLoop(5);
EditorManager::closeAllEditors(false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment