diff options
author | Ulf Hermann <[email protected]> | 2019-05-07 12:47:33 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2019-05-16 12:09:23 +0000 |
commit | 7f7d87c68da4cb29b2b2b9c324c6863228da0c26 (patch) | |
tree | 727a7b7483fe5322984e3068b9cd8696a98efe4b /src/qmltest/quicktest.cpp | |
parent | cf2bf011ae0f33bed963d088f8267746a3369c4c (diff) |
Split CompiledData::CompilationUnit in two
We need a CompilationUnit that only holds the data needed for
compilation and another one that is executable by the runtime.
Change-Id: I704d859ba028576a18460f5e3a59f210f64535d3
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qmltest/quicktest.cpp')
-rw-r--r-- | src/qmltest/quicktest.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index 9cddf61543..6aff7af0e7 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -70,6 +70,7 @@ #include <QtQml/QQmlFileSelector> #include <private/qqmlcomponent_p.h> +#include <private/qv4executablecompilationunit_p.h> #ifdef QT_QMLTEST_WITH_WIDGETS #include <QtWidgets/QApplication> @@ -290,7 +291,8 @@ public: m_errors += component.errors(); if (component.isReady()) { - QQmlRefPointer<CompilationUnit> rootCompilationUnit = QQmlComponentPrivate::get(&component)->compilationUnit; + QQmlRefPointer<QV4::ExecutableCompilationUnit> rootCompilationUnit + = QQmlComponentPrivate::get(&component)->compilationUnit; TestCaseEnumerationResult result = enumerateTestCases(rootCompilationUnit.data()); m_testCases = result.testCases + result.finalizedPartialTestCases(); m_errors += result.errors; @@ -330,7 +332,8 @@ private: } }; - TestCaseEnumerationResult enumerateTestCases(CompilationUnit *compilationUnit, const Object *object = nullptr) + TestCaseEnumerationResult enumerateTestCases(QV4::ExecutableCompilationUnit *compilationUnit, + const Object *object = nullptr) { QQmlType testCaseType; for (quint32 i = 0, count = compilationUnit->importCount(); i < count; ++i) { @@ -353,7 +356,9 @@ private: if (!object) // Start at root of compilation unit if not enumerating a specific child object = compilationUnit->objectAt(0); - if (CompilationUnit *superTypeUnit = compilationUnit->resolvedTypes.value(object->inheritedTypeNameIndex)->compilationUnit.data()) { + if (QV4::ExecutableCompilationUnit *superTypeUnit + = compilationUnit->resolvedTypes.value(object->inheritedTypeNameIndex) + ->compilationUnit.data()) { // We have a non-C++ super type, which could indicate we're a subtype of a TestCase if (testCaseType.isValid() && superTypeUnit->url() == testCaseType.sourceUrl()) result.isTestCase = true; |