Squish: Expect file changes when recording

Expect the object map to change in general and the test script file
to change on successful recording to avoid unneeded confirmation by
the user.

Change-Id: I72fe4534fdc7b6b7064222f7c9b0e0989cc17976
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2022-10-04 12:55:09 +02:00
parent 718086dea8
commit 6a4b3e67e0

View File

@@ -12,6 +12,7 @@
#include <QDebug> // TODO remove #include <QDebug> // TODO remove
#include <coreplugin/documentmanager.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <debugger/breakhandler.h> #include <debugger/breakhandler.h>
@@ -637,6 +638,8 @@ void SquishTools::setupAndStartRecorder()
m_recorderProcess.setCommand({toolsSettings.runnerPath, args}); m_recorderProcess.setCommand({toolsSettings.runnerPath, args});
qCDebug(LOG) << "Recorder starting:" << m_recorderProcess.commandLine().toUserOutput(); qCDebug(LOG) << "Recorder starting:" << m_recorderProcess.commandLine().toUserOutput();
if (m_suiteConf.objectMapPath().isReadableFile())
Core::DocumentManager::expectFileChange(m_suiteConf.objectMapPath());
m_recorderProcess.start(); m_recorderProcess.start();
} }
@@ -737,6 +740,7 @@ void SquishTools::onRecorderFinished()
const ScriptHelper helper(m_suiteConf.language()); const ScriptHelper helper(m_suiteConf.language());
const Utils::FilePath testFile = m_currentTestCasePath.pathAppended( const Utils::FilePath testFile = m_currentTestCasePath.pathAppended(
"test" + m_suiteConf.scriptExtension()); "test" + m_suiteConf.scriptExtension());
Core::DocumentManager::expectFileChange(testFile);
bool result = helper.writeScriptFile(testFile, m_currentRecorderSnippetFile, bool result = helper.writeScriptFile(testFile, m_currentRecorderSnippetFile,
m_suiteConf.aut(), m_suiteConf.aut(),
m_suiteConf.arguments()); m_suiteConf.arguments());