summaryrefslogtreecommitdiff
path: root/plugins/autotest/testsquishtools.cpp
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@theqtcompany.com>2015-06-12 13:00:10 +0200
committerRobert Loehning <robert.loehning@theqtcompany.com>2015-06-19 14:56:06 +0300
commitc42bda94576bb6c9f7364414a58f86c55d171df9 (patch)
tree420702f1c66d84f35f1b50348abbdbf61cf7e2e6 /plugins/autotest/testsquishtools.cpp
parent4605814c1d48f31fd150f32c2687596aeb3cb74e (diff)
downloadqt-creator-wip/at-squish.tar.gz
Handle squishrunner quickly returningwip/at-squish
Change-Id: Idc77d3fc5defd46e912b4ab0cdc4e82214ec75e9 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'plugins/autotest/testsquishtools.cpp')
-rw-r--r--plugins/autotest/testsquishtools.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/autotest/testsquishtools.cpp b/plugins/autotest/testsquishtools.cpp
index 62bde4e62b..523315f6c2 100644
--- a/plugins/autotest/testsquishtools.cpp
+++ b/plugins/autotest/testsquishtools.cpp
@@ -65,8 +65,6 @@ TestSquishTools::TestSquishTools(QObject *parent)
resultPane, &TestResultsPane::addLogoutput, Qt::QueuedConnection);
connect(this, &TestSquishTools::squishTestRunStarted,
resultPane, &TestResultsPane::clearContents);
- connect(this, &TestSquishTools::squishTestRunFinished,
- resultPane, &TestResultsPane::updateSquishSummaryLabel);
}
TestSquishTools::~TestSquishTools()
@@ -505,6 +503,9 @@ void TestSquishTools::onRunnerFinished(int, QProcess::ExitStatus)
m_resultsFileWatcher = 0;
}
if (m_currentResultsXML) {
+ // make sure results are being read if not done yet
+ if (m_currentResultsXML->exists() && !m_currentResultsXML->isOpen())
+ onResultsDirChanged(m_currentResultsXML->fileName());
if (m_currentResultsXML->isOpen())
m_currentResultsXML->close();
delete m_currentResultsXML;
@@ -634,6 +635,9 @@ void TestSquishTools::onRunnerErrorOutput()
void TestSquishTools::onResultsDirChanged(const QString &filePath)
{
+ if (!m_currentResultsXML)
+ return; // runner finished before, m_currentResultsXML deleted
+
if (m_currentResultsXML->exists()) {
delete m_resultsFileWatcher;
m_resultsFileWatcher = 0;
@@ -643,6 +647,8 @@ void TestSquishTools::onResultsDirChanged(const QString &filePath)
m_resultsFileWatcher->addPath(m_currentResultsXML->fileName());
connect(m_resultsFileWatcher, &QFileSystemWatcher::fileChanged,
this, &TestSquishTools::onRunnerOutput);
+ // squishrunner might have finished already, call once at least
+ onRunnerOutput(m_currentResultsXML->fileName());
} else {
// TODO set a flag to process results.xml as soon the complete test run has finished
qWarning() << "could not open results.xml although it exists"