forked from qt-creator/qt-creator
AutoTest: Add option to disable derived checks
Previously the quick test parser would always check each symbol its interested in to see if it might be derived from "TestCase". This is very expensive. This patch adds an option allowing the user to enable or disable the check. By default the check is disabled. Change-Id: Ia6b230b344add672e53ad7fb52845c78a2914b99 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -18,9 +18,12 @@ namespace Internal {
|
||||
|
||||
static QStringList specialFunctions({"initTestCase", "cleanupTestCase", "init", "cleanup"});
|
||||
|
||||
TestQmlVisitor::TestQmlVisitor(QmlJS::Document::Ptr doc, const QmlJS::Snapshot &snapshot)
|
||||
TestQmlVisitor::TestQmlVisitor(QmlJS::Document::Ptr doc,
|
||||
const QmlJS::Snapshot &snapshot,
|
||||
bool checkForDerivedTest)
|
||||
: m_currentDoc(doc)
|
||||
, m_snapshot(snapshot)
|
||||
, m_checkForDerivedTest(checkForDerivedTest)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -68,8 +71,10 @@ bool TestQmlVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
const QStringView name = ast->qualifiedTypeNameId->name;
|
||||
m_objectIsTestStack.push(false);
|
||||
if (name != QLatin1String("TestCase")) {
|
||||
if (!isDerivedFromTestCase(ast->qualifiedTypeNameId, m_currentDoc, m_snapshot))
|
||||
if (!m_checkForDerivedTest
|
||||
|| !isDerivedFromTestCase(ast->qualifiedTypeNameId, m_currentDoc, m_snapshot)) {
|
||||
return true;
|
||||
}
|
||||
} else if (!documentImportsQtTest(m_currentDoc.data())) {
|
||||
return true; // find nested TestCase items as well
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user