summaryrefslogtreecommitdiff
path: root/src/plugins/autotest/quick/quicktestparser.cpp
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2016-07-12 09:45:55 +0200
committerChristian Stenger <christian.stenger@qt.io>2016-07-15 09:19:12 +0000
commit0b527de52e2e5b58169efd1221a4610260c82b75 (patch)
tree75a094ee4381b34b89f586c48ce93ddfff88af74 /src/plugins/autotest/quick/quicktestparser.cpp
parente51443ce62d35c6af43818234ba86ce79d1713e6 (diff)
downloadqt-creator-0b527de52e2e5b58169efd1221a4610260c82b75.tar.gz
AutoTest: Fix parsing for QuickTests
If the scan for quick tests was triggered just by a change of a qml file (including indexing by the respective modelmanager) we might find tests that won't be able to execute. If we have already found quick tests we know their respective project files. If we cannot find the files to be scanned inside the already found ignore scan requests for such files. This patch is kind of a continuation of b570ee1b801da0906fdba9e0218e681b003a9857 (Fix initial parsing when loading session) Change-Id: Ic1228641f60abf127134acbd4232a0ddd30ef159 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/autotest/quick/quicktestparser.cpp')
-rw-r--r--src/plugins/autotest/quick/quicktestparser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp
index 49ad52c671..c31e54a34e 100644
--- a/src/plugins/autotest/quick/quicktestparser.cpp
+++ b/src/plugins/autotest/quick/quicktestparser.cpp
@@ -220,6 +220,7 @@ static bool handleQtQuickTest(QFutureInterface<TestParseResultPtr> futureInterfa
void QuickTestParser::init(const QStringList &filesToParse)
{
m_qmlSnapshot = QmlJSTools::Internal::ModelManager::instance()->snapshot();
+ m_proFilesForQmlFiles = QuickTestUtils::proFilesForQmlFiles(id(), filesToParse);
CppParser::init(filesToParse);
}
@@ -227,8 +228,11 @@ bool QuickTestParser::processDocument(QFutureInterface<TestParseResultPtr> futur
const QString &fileName)
{
if (fileName.endsWith(".qml")) {
+ const QString &proFile = m_proFilesForQmlFiles.value(fileName);
+ if (proFile.isEmpty())
+ return false;
QmlJS::Document::Ptr qmlJSDoc = m_qmlSnapshot.document(fileName);
- return checkQmlDocumentForQuickTestCode(futureInterface, qmlJSDoc, id());
+ return checkQmlDocumentForQuickTestCode(futureInterface, qmlJSDoc, id(), proFile);
}
if (!m_cppSnapshot.contains(fileName) || !selectedForBuilding(fileName))
return false;