diff options
author | Robert Loehning <robert.loehning@theqtcompany.com> | 2015-06-12 13:00:10 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@theqtcompany.com> | 2015-06-19 14:56:06 +0300 |
commit | c42bda94576bb6c9f7364414a58f86c55d171df9 (patch) | |
tree | 420702f1c66d84f35f1b50348abbdbf61cf7e2e6 | |
parent | 4605814c1d48f31fd150f32c2687596aeb3cb74e (diff) | |
download | qt-creator-c42bda94576bb6c9f7364414a58f86c55d171df9.tar.gz |
Handle squishrunner quickly returningwip/at-squish
Change-Id: Idc77d3fc5defd46e912b4ab0cdc4e82214ec75e9
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r-- | plugins/autotest/testresultspane.cpp | 2 | ||||
-rw-r--r-- | plugins/autotest/testresultspane.h | 2 | ||||
-rw-r--r-- | plugins/autotest/testsquishtools.cpp | 10 |
3 files changed, 11 insertions, 3 deletions
diff --git a/plugins/autotest/testresultspane.cpp b/plugins/autotest/testresultspane.cpp index d2425ce80b..29c6549ffe 100644 --- a/plugins/autotest/testresultspane.cpp +++ b/plugins/autotest/testresultspane.cpp @@ -159,6 +159,8 @@ TestResultsPane::~TestResultsPane() void TestResultsPane::addTestResult(const TestResult &result) { m_model->addTestResult(result); + if (result.result() >= Result::SQUISH_GROUP_BEGIN && result.result() <= Result::SQUISH_GROUP_END) + updateSquishSummaryLabel(); if (!m_treeView->isVisible()) popup(Core::IOutputPane::NoModeSwitch); flash(); diff --git a/plugins/autotest/testresultspane.h b/plugins/autotest/testresultspane.h index a448fe6f04..f1d9911a7a 100644 --- a/plugins/autotest/testresultspane.h +++ b/plugins/autotest/testresultspane.h @@ -70,13 +70,13 @@ public: bool canPrevious() const; void goToNext(); void goToPrev(); + void updateSquishSummaryLabel(); signals: public slots: void addTestResult(const TestResult &result); void addLogoutput(const QString &output); - void updateSquishSummaryLabel(); private slots: void onItemActivated(const QModelIndex &index); 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" |