forked from qt-creator/qt-creator
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: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user