forked from qt-creator/qt-creator
AutoTest: Handle sub-typed TestCases correctly
Furthermore ensure that TestCase is really the Qml type to avoid handling self-defined types as Quick Tests. Task-number: QTCREATORBUG-17787 Change-Id: I08a6c70c3c166eefec6f24669cc225f568e51c7a Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Internal {
|
||||
class TestQmlVisitor : public QmlJS::AST::Visitor
|
||||
{
|
||||
public:
|
||||
explicit TestQmlVisitor(QmlJS::Document::Ptr doc);
|
||||
explicit TestQmlVisitor(QmlJS::Document::Ptr doc, const QmlJS::Snapshot &snapshot);
|
||||
|
||||
bool visit(QmlJS::AST::UiObjectDefinition *ast);
|
||||
bool visit(QmlJS::AST::ExpressionStatement *ast);
|
||||
@@ -47,12 +47,15 @@ public:
|
||||
QString testCaseName() const { return m_currentTestCaseName; }
|
||||
TestCodeLocationAndType testCaseLocation() const { return m_testCaseLocation; }
|
||||
QMap<QString, TestCodeLocationAndType> testFunctions() const { return m_testFunctions; }
|
||||
bool isValid() const { return m_typeIsTestCase; }
|
||||
|
||||
private:
|
||||
QmlJS::Document::Ptr m_currentDoc;
|
||||
QmlJS::Snapshot m_snapshot;
|
||||
QString m_currentTestCaseName;
|
||||
TestCodeLocationAndType m_testCaseLocation;
|
||||
QMap<QString, TestCodeLocationAndType> m_testFunctions;
|
||||
bool m_typeIsTestCase = false;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user