forked from qt-creator/qt-creator
AutoTest: Ensure reparse even for unlisted Qml files
Files containing Quick tests are not necessarily listed inside the project file. If such an unlisted file is updated we have to scan for tests even if it is not part of the project otherwise it would not get updated inside the test tree. Task-number: QTCREATORBUG-18692 Change-Id: I4c4c67d50b4fff13138b0ab3c884f5ea48a7b8bf Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
@@ -199,7 +199,7 @@ static bool parsingHasFailed;
|
|||||||
|
|
||||||
/****** threaded parsing stuff *******/
|
/****** threaded parsing stuff *******/
|
||||||
|
|
||||||
void TestCodeParser::onDocumentUpdated(const QString &fileName)
|
void TestCodeParser::onDocumentUpdated(const QString &fileName, bool isQmlFile)
|
||||||
{
|
{
|
||||||
if (m_codeModelParsing || m_fullUpdatePostponed)
|
if (m_codeModelParsing || m_fullUpdatePostponed)
|
||||||
return;
|
return;
|
||||||
@@ -207,7 +207,8 @@ void TestCodeParser::onDocumentUpdated(const QString &fileName)
|
|||||||
Project *project = SessionManager::startupProject();
|
Project *project = SessionManager::startupProject();
|
||||||
if (!project)
|
if (!project)
|
||||||
return;
|
return;
|
||||||
if (!SessionManager::projectContainsFile(project, Utils::FileName::fromString(fileName)))
|
// Quick tests: qml files aren't necessarily listed inside project files
|
||||||
|
if (!isQmlFile && !SessionManager::projectContainsFile(project, Utils::FileName::fromString(fileName)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scanForTests(QStringList(fileName));
|
scanForTests(QStringList(fileName));
|
||||||
@@ -222,7 +223,7 @@ void TestCodeParser::onQmlDocumentUpdated(const QmlJS::Document::Ptr &document)
|
|||||||
{
|
{
|
||||||
const QString fileName = document->fileName();
|
const QString fileName = document->fileName();
|
||||||
if (!fileName.endsWith(".qbs"))
|
if (!fileName.endsWith(".qbs"))
|
||||||
onDocumentUpdated(fileName);
|
onDocumentUpdated(fileName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCodeParser::onStartupProjectChanged(Project *project)
|
void TestCodeParser::onStartupProjectChanged(Project *project)
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ private:
|
|||||||
bool postponed(const QStringList &fileList);
|
bool postponed(const QStringList &fileList);
|
||||||
void scanForTests(const QStringList &fileList = QStringList(), ITestParser *parser = nullptr);
|
void scanForTests(const QStringList &fileList = QStringList(), ITestParser *parser = nullptr);
|
||||||
|
|
||||||
void onDocumentUpdated(const QString &fileName);
|
// qml files must be handled slightly different
|
||||||
|
void onDocumentUpdated(const QString &fileName, bool isQmlFile = false);
|
||||||
void onTaskStarted(Core::Id type);
|
void onTaskStarted(Core::Id type);
|
||||||
void onAllTasksFinished(Core::Id type);
|
void onAllTasksFinished(Core::Id type);
|
||||||
void onFinished();
|
void onFinished();
|
||||||
|
|||||||
Reference in New Issue
Block a user