OpenCoverage

quicktest.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qmltest/quicktest.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9class QTestRootObject : public QObject-
10{-
11 public:-
12#pragma GCC diagnostic push-
13 -
14#pragma GCC diagnostic ignored "-Wsuggest-override"-
15 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
16#pragma GCC diagnostic ignored "-Wattributes"-
17 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
18#pragma GCC diagnostic pop-
19 struct QPrivateSignal {};-
20 -
21 -
22 -
23public:-
24 QTestRootObject(QObject *parent = nullptr)-
25 : QObject(parent), hasQuit(false), m_windowShown(false), m_hasTestCase(false) {-
26 m_defined = new QQmlPropertyMap(this);-
27-
28-
29-
30 }
executed 32 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
32
31-
32 static QTestRootObject *instance() {-
33 static QPointer<QTestRootObject> object = new QTestRootObject;-
34 if (!object
!objectDescription
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
FALSEevaluated 176 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
16-176
35-
36 object = new QTestRootObject;-
37 }
executed 16 times by 3 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
16
38 return
executed 192 times by 4 tests: return object;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
object;
executed 192 times by 4 tests: return object;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
192
39 }-
40-
41 bool hasQuit:1;-
42 bool hasTestCase() const { return
never executed: return m_hasTestCase;
m_hasTestCase;
never executed: return m_hasTestCase;
}
0
43 void setHasTestCase(bool value) { m_hasTestCase = value; hasTestCaseChanged(); }
executed 64 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
64
44-
45 bool windowShown() const { return
executed 48 times by 4 tests: return m_windowShown;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
m_windowShown;
executed 48 times by 4 tests: return m_windowShown;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
}
48
46 void setWindowShown(bool value) { m_windowShown = value; windowShownChanged(); }
executed 48 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
48
47 QQmlPropertyMap *defined() const { return
never executed: return m_defined;
m_defined;
never executed: return m_defined;
}
0
48-
49 void init() { setWindowShown(false); setHasTestCase(false); hasQuit = false; }
executed 32 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
32
50-
51public :-
52 void windowShownChanged();-
53 void hasTestCaseChanged();-
54-
55private :-
56 void quit() { hasQuit = true; }
executed 32 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
32
57-
58private:-
59 bool m_windowShown : 1;-
60 bool m_hasTestCase :1;-
61 QQmlPropertyMap *m_defined;-
62};-
63-
64static QObject *testRootObject(QQmlEngine *engine, QJSEngine *jsEngine)-
65{-
66 (void)engine;;-
67 (void)jsEngine;;-
68 return
executed 32 times by 4 tests: return QTestRootObject::instance();
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
QTestRootObject::instance();
executed 32 times by 4 tests: return QTestRootObject::instance();
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
32
69}-
70-
71static inline QString stripQuotes(const QString &s)-
72{-
73 if (s.length() >= 2
s.length() >= 2Description
TRUEnever evaluated
FALSEnever evaluated
&& s.startsWith(QLatin1Char('"'))
s.startsWith(QLatin1Char('"'))Description
TRUEnever evaluated
FALSEnever evaluated
&& s.endsWith(QLatin1Char('"'))
s.endsWith(QLatin1Char('"'))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
74 return
never executed: return s.mid(1, s.length() - 2);
s.mid(1, s.length() - 2);
never executed: return s.mid(1, s.length() - 2);
0
75 else-
76 return
never executed: return s;
s;
never executed: return s;
0
77}-
78-
79void handleCompileErrors(const QFileInfo &fi, QQuickView *view)-
80{-
81-
82 const QList<QQmlError> errors = view->errors();-
83 QuickTestResult results;-
84 results.setTestCaseName(fi.baseName());-
85 results.startLogging();-
86 results.setFunctionName(QLatin1String("compile"));-
87-
88 QString message;-
89 QTextStream str(&message);-
90 str << "\n " << QDir::toNativeSeparators(fi.absoluteFilePath()) << " produced "-
91 << errors.size() << " error(s):\n";-
92 for (const QQmlError &e : errors) {-
93 str << " ";-
94 if (e.url().isLocalFile()
e.url().isLocalFile()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
95 str << QDir::toNativeSeparators(e.url().toLocalFile());-
96 }
never executed: end of block
else {
0
97 str << e.url().toString();-
98 }
never executed: end of block
0
99 if (e.line() > 0
e.line() > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
100 str << ':' << e.line() << ',' << e.column();
never executed: str << ':' << e.line() << ',' << e.column();
0
101 str << ": " << e.description() << '\n';-
102 }
never executed: end of block
0
103 str << " Working directory: " << QDir::toNativeSeparators(QDir::current().absolutePath()) << '\n';-
104 if (QQmlEngine *engine = view->engine()
QQmlEngine *en...view->engine()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
105 str << " View: " << view->metaObject()->className() << ", import paths:\n";-
106 const auto importPaths = engine->importPathList();-
107 for (const QString &i : importPaths)-
108 str << " '" << QDir::toNativeSeparators(i) << "'\n";
never executed: str << " '" << QDir::toNativeSeparators(i) << "'\n";
0
109 const QStringList pluginPaths = engine->pluginPathList();-
110 str << " Plugin paths:\n";-
111 for (const QString &p : pluginPaths)-
112 str << " '" << QDir::toNativeSeparators(p) << "'\n";
never executed: str << " '" << QDir::toNativeSeparators(p) << "'\n";
0
113 }
never executed: end of block
0
114 QMessageLogger(__FILE__, 172, __PRETTY_FUNCTION__).warning("%s", QtPrivate::asString(message).toLocal8Bit().constData());-
115-
116 results.fail(errors.at(0).description(),-
117 errors.at(0).url(), errors.at(0).line());-
118 results.finishTestData();-
119 results.finishTestDataCleanup();-
120 results.finishTestFunction();-
121 results.setFunctionName(QString());-
122 results.stopLogging();-
123}
never executed: end of block
0
124-
125bool qWaitForSignal(QObject *obj, const char* signal, int timeout = 5000)-
126{-
127 QSignalSpy spy(obj, signal);-
128 QElapsedTimer timer;-
129 timer.start();-
130-
131 while (!spy.size()
!spy.size()Description
TRUEevaluated 109 times by 1 test
Evaluated by:
  • tst_qquicklayouts
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qquicklayouts
) {
56-109
132 int remaining = timeout - int(timer.elapsed());-
133 if (remaining <= 0
remaining <= 0Description
TRUEnever evaluated
FALSEevaluated 109 times by 1 test
Evaluated by:
  • tst_qquicklayouts
)
0-109
134 break;
never executed: break;
0
135 QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);-
136 QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);-
137 QTest::qSleep(10);-
138 }
executed 109 times by 1 test: end of block
Executed by:
  • tst_qquicklayouts
109
139-
140 return
executed 56 times by 1 test: return spy.size();
Executed by:
  • tst_qquicklayouts
spy.size();
executed 56 times by 1 test: return spy.size();
Executed by:
  • tst_qquicklayouts
56
141}-
142-
143using namespace QV4::CompiledData;-
144-
145class TestCaseCollector-
146{-
147public:-
148 typedef QList<QString> TestCaseList;-
149-
150 TestCaseCollector(const QFileInfo &fileInfo, QQmlEngine *engine)-
151 {-
152 QString path = fileInfo.absoluteFilePath();-
153 if (path.startsWith(QLatin1String(":/"))
path.startsWit...1String(":/"))Description
TRUEnever evaluated
FALSEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
0-42
154 path.prepend(QLatin1String("qrc"));
never executed: path.prepend(QLatin1String("qrc"));
0
155-
156 QQmlComponent component(engine, path);-
157 m_errors += component.errors();-
158-
159 if (component.isReady()
component.isReady()Description
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
) {
0-42
160 QQmlRefPointer<CompilationUnit> rootCompilationUnit = QQmlComponentPrivate::get(&component)->compilationUnit;-
161 TestCaseEnumerationResult result = enumerateTestCases(rootCompilationUnit.data());-
162 m_testCases = result.testCases + result.finalizedPartialTestCases();-
163 m_errors += result.errors;-
164 }
executed 42 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
165 }
executed 42 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
166-
167 TestCaseList testCases() const { return
executed 42 times by 4 tests: return m_testCases;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
m_testCases;
executed 42 times by 4 tests: return m_testCases;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
}
42
168 QList<QQmlError> errors() const { return
executed 42 times by 4 tests: return m_errors;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
m_errors;
executed 42 times by 4 tests: return m_errors;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
}
42
169-
170private:-
171 TestCaseList m_testCases;-
172 QList<QQmlError> m_errors;-
173-
174 struct TestCaseEnumerationResult-
175 {-
176 TestCaseList testCases;-
177 QList<QQmlError> errors;-
178-
179-
180 bool isTestCase = false;-
181 TestCaseList testFunctions;-
182 QString testCaseName;-
183-
184 TestCaseList finalizedPartialTestCases() const-
185 {-
186 TestCaseList result;-
187 for (const QString &function : testFunctions)-
188 result << QString(([]() noexcept -> QString { enum { Size = sizeof(u"" "%1::%2")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "%1::%2" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 168 times by 3 tests: return qstring_literal_temp;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
qstring_literal_temp;
executed 168 times by 3 tests: return qstring_literal_temp;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
}())).arg(testCaseName).arg(function);
executed 168 times by 3 tests: result << QString(([]() noexcept -> QString { enum { Size = sizeof(u"" "%1::%2")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "%1::%2" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())).arg(testCaseName).arg(function);
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
168
189 return
executed 430 times by 4 tests: return result;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
result;
executed 430 times by 4 tests: return result;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
430
190 }-
191-
192 TestCaseEnumerationResult &operator<<(const TestCaseEnumerationResult &other)-
193 {-
194 testCases += other.testCases + other.finalizedPartialTestCases();-
195 errors += other.errors;-
196 return
executed 388 times by 2 tests: return *this;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
*this;
executed 388 times by 2 tests: return *this;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
388
197 }-
198 };-
199-
200 TestCaseEnumerationResult enumerateTestCases(CompilationUnit *compilationUnit, const Object *object = nullptr)-
201 {-
202 QQmlType testCaseType;-
203 for (quint32 i = 0; i < compilationUnit->data->nImports
i < compilatio...data->nImportsDescription
TRUEevaluated 860 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
; ++i) {
0-860
204 const Import *import = compilationUnit->data->importAt(i);-
205 if (compilationUnit->stringAt(import->uriIndex) != QLatin1Literal("QtTest")
compilationUni...eral("QtTest")Description
TRUEevaluated 430 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 430 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
430
206 continue;
executed 430 times by 4 tests: continue;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
430
207-
208 QString testCaseTypeName(([]() noexcept -> QString { enum { Size = sizeof(u"" "TestCase")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "TestCase" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 430 times by 4 tests: return qstring_literal_temp;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
qstring_literal_temp;
executed 430 times by 4 tests: return qstring_literal_temp;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
}()));
430
209 QString typeQualifier = compilationUnit->stringAt(import->qualifierIndex);-
210 if (!typeQualifier.isEmpty()
!typeQualifier.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 430 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
0-430
211 testCaseTypeName = typeQualifier % QLatin1Char('.') % testCaseTypeName;
never executed: testCaseTypeName = typeQualifier % QLatin1Char('.') % testCaseTypeName;
0
212-
213 testCaseType = compilationUnit->typeNameCache->query(testCaseTypeName).type;-
214 if (testCaseType.isValid()
testCaseType.isValid()Description
TRUEevaluated 430 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
)
0-430
215 break;
executed 430 times by 4 tests: break;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
430
216 }
never executed: end of block
0
217-
218 TestCaseEnumerationResult result;-
219-
220 if (!object
!objectDescription
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 388 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
)
42-388
221 object = compilationUnit->objectAt(0);
executed 42 times by 4 tests: object = compilationUnit->objectAt(0);
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
222-
223 if (CompilationUnit *superTypeUnit = compilationUnit->resolvedTypes.value(object->inheritedTypeNameIndex)->compilationUnit.data()
CompilationUni...ionUnit.data()Description
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 388 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
) {
42-388
224-
225 if (testCaseType.isValid()
testCaseType.isValid()Description
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
&& superTypeUnit->url() == testCaseType.sourceUrl()
superTypeUnit-...pe.sourceUrl()Description
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
)
0-42
226 result.isTestCase = true;
executed 42 times by 4 tests: result.isTestCase = true;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
227 else-
228 result = enumerateTestCases(superTypeUnit);
never executed: result = enumerateTestCases(superTypeUnit);
0
229-
230 if (result.isTestCase
result.isTestCaseDescription
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
) {
0-42
231-
232 for (auto binding = object->bindingsBegin(); binding != object->bindingsEnd()
binding != obj...>bindingsEnd()Description
TRUEevaluated 70 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
; ++binding) {
0-70
233 if (compilationUnit->stringAt(binding->propertyNameIndex) == QLatin1Literal("name")
compilationUni...iteral("name")Description
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
) {
28-42
234 if (binding->type == QV4::CompiledData::Binding::Type_String
binding->type ...g::Type_StringDescription
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
) {
0-42
235 result.testCaseName = compilationUnit->stringAt(binding->stringIndex);-
236 }
executed 42 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
else {
42
237 QQmlError error;-
238 error.setUrl(compilationUnit->url());-
239 error.setLine(binding->location.line);-
240 error.setColumn(binding->location.column);-
241 error.setDescription(([]() noexcept -> QString { enum { Size = sizeof(u"" "the 'name' property of a TestCase must be a literal string")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "the 'name' property of a TestCase must be a literal string" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()));
0
242 result.errors << error;-
243 }
never executed: end of block
0
244 break;
executed 42 times by 4 tests: break;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
245 }-
246 }
executed 28 times by 2 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
28
247-
248-
249 auto functionsEnd = compilationUnit->objectFunctionsEnd(object);-
250 for (auto function = compilationUnit->objectFunctionsBegin(object); function != functionsEnd
function != functionsEndDescription
TRUEevaluated 190 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
; ++function) {
42-190
251 QString functionName = compilationUnit->stringAt(function->nameIndex);-
252 if (!(functionName.startsWith(QLatin1Literal("test_"))
functionName.s...eral("test_"))Description
TRUEevaluated 180 times by 3 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
|| functionName.startsWith(QLatin1Literal("benchmark_"))
functionName.s..."benchmark_"))Description
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
))
0-180
253 continue;
executed 10 times by 2 tests: continue;
Executed by:
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
10
254-
255 if (functionName.endsWith(QLatin1Literal("_data"))
functionName.e...eral("_data"))Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
FALSEevaluated 168 times by 3 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
)
12-168
256 continue;
executed 12 times by 2 tests: continue;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
12
257-
258 result.testFunctions << functionName;-
259 }
executed 168 times by 3 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
168
260 }
executed 42 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
261 }
executed 42 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
262-
263 for (auto binding = object->bindingsBegin(); binding != object->bindingsEnd()
binding != obj...>bindingsEnd()Description
TRUEevaluated 1254 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 430 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
; ++binding) {
430-1254
264 if (binding->type == QV4::CompiledData::Binding::Type_Object
binding->type ...g::Type_ObjectDescription
TRUEevaluated 388 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
FALSEevaluated 866 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
388-866
265 const Object *child = compilationUnit->objectAt(binding->value.objectIndex);-
266 result << enumerateTestCases(compilationUnit, child);-
267 }
executed 388 times by 2 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
388
268 }
executed 1254 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
1254
269-
270 return
executed 430 times by 4 tests: return result;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
result;
executed 430 times by 4 tests: return result;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
430
271 }-
272};-
273-
274int quick_test_main(int argc, char **argv, const char *name, const char *sourceDir)-
275{-
276 return
executed 16 times by 3 tests: return quick_test_main_with_setup(argc, argv, name, sourceDir, nullptr);
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
quick_test_main_with_setup(argc, argv, name, sourceDir, nullptr);
executed 16 times by 3 tests: return quick_test_main_with_setup(argc, argv, name, sourceDir, nullptr);
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
16
277}-
278-
279int quick_test_main_with_setup(int argc, char **argv, const char *name, const char *sourceDir, QObject *setup)-
280{-
281-
282-
283 bool withWidgets = false;-
284 for (int index = 1; index < argc
index < argcDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
; ++index) {
18-20
285 if (strcmp(argv[index], "-widgets") == 0
strcmp(argv[in...widgets") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
) {
0-20
286 withWidgets = true;-
287 break;
never executed: break;
0
288 }-
289 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_testfiltering
20
290-
291-
292 QCoreApplication *app = nullptr;-
293 if (!QCoreApplication::instance()
!QCoreApplication::instance()Description
TRUEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
) {
0-18
294-
295 if (withWidgets
withWidgetsDescription
TRUEnever evaluated
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
0-18
296 app = new QApplication(argc, argv);
never executed: app = new QApplication(argc, argv);
0
297 else-
298-
299 {-
300 app = new QGuiApplication(argc, argv);-
301 }
executed 18 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
18
302 }-
303-
304 if (setup
setupDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_quicktestmainwithsetup
FALSEevaluated 16 times by 3 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
) {
2-16
305-
306 QMetaObject::invokeMethod(setup, "applicationAvailable");-
307 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_quicktestmainwithsetup
2
308-
309-
310-
311-
312-
313-
314-
315 QStringList imports;-
316 QStringList pluginPaths;-
317 QString testPath;-
318 QString translationFile;-
319 QStringList fileSelectors;-
320 int index = 1;-
321 QScopedArrayPointer<char *> testArgV(new char *[argc + 1]);-
322 testArgV[0] = argv[0];-
323 int testArgC = 1;-
324 while (index < argc
index < argcDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
18-20
325 if (strcmp(argv[index], "-import") == 0
strcmp(argv[in...-import") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
&& (
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
index + 1) < argc
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-20
326 imports += stripQuotes(QString::fromLocal8Bit(argv[index + 1]));-
327 index += 2;-
328 }
never executed: end of block
else if (strcmp(argv[index], "-plugins") == 0
strcmp(argv[in...plugins") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
&& (
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
index + 1) < argc
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-20
329 pluginPaths += stripQuotes(QString::fromLocal8Bit(argv[index + 1]));-
330 index += 2;-
331 }
never executed: end of block
else if (strcmp(argv[index], "-input") == 0
strcmp(argv[in..."-input") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
&& (
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
index + 1) < argc
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-20
332 testPath = stripQuotes(QString::fromLocal8Bit(argv[index + 1]));-
333 index += 2;-
334 }
never executed: end of block
else if (strcmp(argv[index], "-opengl") == 0
strcmp(argv[in...-opengl") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
) {
0-20
335 ++index;-
336-
337 }
never executed: end of block
else if (strcmp(argv[index], "-widgets") == 0
strcmp(argv[in...widgets") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
) {
0-20
338 withWidgets = true;-
339 ++index;-
340-
341 }
never executed: end of block
else if (strcmp(argv[index], "-translation") == 0
strcmp(argv[in...slation") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
&& (
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
index + 1) < argc
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-20
342 translationFile = stripQuotes(QString::fromLocal8Bit(argv[index + 1]));-
343 index += 2;-
344 }
never executed: end of block
else if (strcmp(argv[index], "-file-selector") == 0
strcmp(argv[in...elector") == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
&& (
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
index + 1) < argc
(index + 1) < argcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-20
345 fileSelectors += stripQuotes(QString::fromLocal8Bit(argv[index + 1]));-
346 index += 2;-
347 }
never executed: end of block
else {
0
348 testArgV[testArgC++] = argv[index++];-
349 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_testfiltering
20
350 }-
351 testArgV[testArgC] = 0;-
352-
353-
354-
355 QuickTestResult::setCurrentAppname(argv[0]);-
356 QuickTestResult::setProgramName(name);-
357-
358 QuickTestResult::parseArgs(testArgC, testArgV.data());-
359-
360-
361 QTranslator translator;-
362 if (!translationFile.isEmpty()
!translationFile.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-18
363 if (translator.load(translationFile)
translator.loa...anslationFile)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
364 app->installTranslator(&translator);-
365 }
never executed: end of block
else {
0
366 QMessageLogger(__FILE__, 424, __PRETTY_FUNCTION__).warning("Could not load the translation file '%s'.", QtPrivate::asString(translationFile).toLocal8Bit().constData());-
367 }
never executed: end of block
0
368 }-
369 if (testPath.isEmpty()
testPath.isEmpty()Description
TRUEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
&& sourceDir
sourceDirDescription
TRUEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
) {
0-18
370 const QString s = QString::fromLocal8Bit(sourceDir);-
371 if (QFile::exists(s)
QFile::exists(s)Description
TRUEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
)
0-18
372 testPath = s;
executed 18 times by 4 tests: testPath = s;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
18
373 }
executed 18 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
18
374 if (testPath.isEmpty()
testPath.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-18
375 QDir current = QDir::current();-
376-
377-
378-
379-
380-
381-
382 testPath = current.absolutePath();-
383 }
never executed: end of block
0
384 QStringList files;-
385-
386 const QFileInfo testPathInfo(testPath);-
387 if (testPathInfo.isFile()
testPathInfo.isFile()Description
TRUEnever evaluated
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-18
388 if (!testPath.endsWith(QLatin1String(".qml"))
!testPath.ends...tring(".qml"))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
389 QMessageLogger(__FILE__, 455, __PRETTY_FUNCTION__).warning("'%s' does not have the suffix '.qml'.", QtPrivate::asString(testPath).toLocal8Bit().constData());-
390 return
never executed: return 1;
1;
never executed: return 1;
0
391 }-
392 files << testPath;-
393 }
never executed: end of block
else if (testPathInfo.isDir()
testPathInfo.isDir()Description
TRUEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEnever evaluated
) {
0-18
394-
395 const QStringList filters(([]() noexcept -> QString { enum { Size = sizeof(u"" "tst_*.qml")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "tst_*.qml" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 18 times by 4 tests: return qstring_literal_temp;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
qstring_literal_temp;
executed 18 times by 4 tests: return qstring_literal_temp;
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
}()));
18
396 QDirIterator iter(testPathInfo.absoluteFilePath(), filters, QDir::Files,-
397 QDirIterator::Subdirectories |-
398 QDirIterator::FollowSymlinks);-
399 while (iter.hasNext()
iter.hasNext()Description
TRUEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
18-42
400 files += iter.next();
executed 42 times by 4 tests: files += iter.next();
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
42
401 files.sort();-
402 if (files.isEmpty()
files.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 18 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-18
403 QMessageLogger(__FILE__, 469, __PRETTY_FUNCTION__).warning("The directory '%s' does not contain any test files matching '%s'",-
404 QtPrivate::asString(testPath).toLocal8Bit().constData(), QtPrivate::asString(filters.front()).toLocal8Bit().constData());-
405 return
never executed: return 1;
1;
never executed: return 1;
0
406 }-
407 }
executed 18 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
else {
18
408 QMessageLogger(__FILE__, 474, __PRETTY_FUNCTION__).warning("'%s' does not exist under '%s'.",-
409 QtPrivate::asString(testPath).toLocal8Bit().constData(), QtPrivate::asString(QDir::currentPath()).toLocal8Bit().constData());-
410 return
never executed: return 1;
1;
never executed: return 1;
0
411 }-
412-
413 qputenv("QT_QTESTLIB_RUNNING", "1");-
414-
415-
416 qmlRegisterSingletonType<QTestRootObject>("Qt.test.qtestroot", 1, 0, "QTestRootObject", testRootObject);-
417-
418 QSet<QString> commandLineTestFunctions = QTest::testFunctions.toSet();-
419 const bool filteringTestFunctions = !commandLineTestFunctions.isEmpty();-
420-
421-
422-
423 for (const QString &file : qAsConst(files)) {-
424 const QFileInfo fi(file);-
425 if (!fi.exists()
!fi.exists()Description
TRUEnever evaluated
FALSEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
0-42
426 continue;
never executed: continue;
0
427-
428 QQmlEngine engine;-
429 for (const QString &path : qAsConst(imports))-
430 engine.addImportPath(path);
never executed: engine.addImportPath(path);
0
431 for (const QString &path : qAsConst(pluginPaths))-
432 engine.addPluginPath(path);
never executed: engine.addPluginPath(path);
0
433-
434 if (!fileSelectors.isEmpty()
!fileSelectors.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-42
435 QQmlFileSelector* const qmlFileSelector = new QQmlFileSelector(&engine, &engine);-
436 qmlFileSelector->setExtraSelectors(fileSelectors);-
437 }
never executed: end of block
0
438-
439 TestCaseCollector testCaseCollector(fi, &engine);-
440 if (!testCaseCollector.errors().isEmpty()
!testCaseColle...rs().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-42
441 for (const QQmlError &error : testCaseCollector.errors())-
442 QMessageLogger(__FILE__, 508, __PRETTY_FUNCTION__).warning() << error;
never executed: QMessageLogger(__FILE__, 508, __PRETTY_FUNCTION__).warning() << error;
0
443 exit(1);
never executed: exit(1);
0
444 }-
445-
446 TestCaseCollector::TestCaseList availableTestFunctions = testCaseCollector.testCases();-
447 if (QTest::printAvailableFunctions
QTest::printAvailableFunctionsDescription
TRUEnever evaluated
FALSEevaluated 42 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-42
448 for (const QString &function : availableTestFunctions)-
449 QMessageLogger(__FILE__, 515, __PRETTY_FUNCTION__).debug("%s()", QtPrivate::asString(function).toLocal8Bit().constData());
never executed: QMessageLogger(__FILE__, 515, __PRETTY_FUNCTION__).debug("%s()", QtPrivate::asString(function).toLocal8Bit().constData());
0
450 continue;
never executed: continue;
0
451 }-
452-
453 const QSet<QString> availableTestSet = availableTestFunctions.toSet();-
454 if (filteringTestFunctions
filteringTestFunctionsDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_testfiltering
FALSEevaluated 22 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
&& !availableTestSet.intersects(commandLineTestFunctions)
!availableTest...TestFunctions)Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_testfiltering
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_testfiltering
)
10-22
455 continue;
executed 10 times by 1 test: continue;
Executed by:
  • tst_testfiltering
10
456 commandLineTestFunctions.subtract(availableTestSet);-
457-
458 QQuickView view(&engine, nullptr);-
459 view.setFlags(Qt::Window | Qt::WindowSystemMenuHint-
460 | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint-
461 | Qt::WindowCloseButtonHint);-
462 QEventLoop eventLoop;-
463 QObject::connect(view.engine(), qFlagLocation("2""quit()" "\0" __FILE__ ":" "529"),-
464 QTestRootObject::instance(), qFlagLocation("1""quit()" "\0" __FILE__ ":" "530"));-
465 QObject::connect(view.engine(), qFlagLocation("2""quit()" "\0" __FILE__ ":" "531"),-
466 &eventLoop, qFlagLocation("1""quit()" "\0" __FILE__ ":" "532"));-
467 view.rootContext()->setContextProperty-
468 (QLatin1String("qtest"), QTestRootObject::instance());-
469-
470-
471-
472 if (setup
setupDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_quicktestmainwithsetup
FALSEevaluated 30 times by 3 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_testfiltering
) {
2-30
473-
474-
475 QMetaObject::invokeMethod(setup, "qmlEngineAvailable", QArgument<QQmlEngine* >("QQmlEngine*", view.engine()));-
476 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_quicktestmainwithsetup
2
477-
478 view.setObjectName(fi.baseName());-
479 view.setTitle(view.objectName());-
480 QTestRootObject::instance()->init();-
481 QString path = fi.absoluteFilePath();-
482 if (path.startsWith(QLatin1String(":/"))
path.startsWit...1String(":/"))Description
TRUEnever evaluated
FALSEevaluated 32 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
0-32
483 view.setSource(QUrl(QLatin1String("qrc:") + path.midRef(1)));
never executed: view.setSource(QUrl(QLatin1String("qrc:") + path.midRef(1)));
0
484 else-
485 view.setSource(QUrl::fromLocalFile(path));
executed 32 times by 4 tests: view.setSource(QUrl::fromLocalFile(path));
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
32
486-
487 while (view.status() == QQuickView::Loading
view.status() ...kView::LoadingDescription
TRUEnever evaluated
FALSEevaluated 32 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
)
0-32
488 QTest::qWait(10);
never executed: QTest::qWait(10);
0
489 if (view.status() == QQuickView::Error
view.status() ...ickView::ErrorDescription
TRUEnever evaluated
FALSEevaluated 32 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
0-32
490 handleCompileErrors(fi, &view);-
491 continue;
never executed: continue;
0
492 }-
493 if (!QTestRootObject::instance()->hasQuit
!QTestRootObje...nce()->hasQuitDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
16
494-
495-
496-
497-
498-
499 view.setFramePosition(QPoint(50, 50));-
500 if (view.size().isEmpty()
view.size().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
) {
0-16
501 view.resize(200, 200);-
502 }
never executed: end of block
0
503 view.show();-
504 if (!QTest::qWaitForWindowExposed(&view)
!QTest::qWaitF...Exposed(&view)Description
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
) {
0-16
505 QMessageLogger(__FILE__, 571, __PRETTY_FUNCTION__).warning().nospace()-
506 << "Test '" << QDir::toNativeSeparators(path) << "' window not exposed after show().";-
507 }
never executed: end of block
0
508 view.requestActivate();-
509 if (!QTest::qWaitForWindowActive(&view)
!QTest::qWaitF...wActive(&view)Description
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
) {
0-16
510 QMessageLogger(__FILE__, 576, __PRETTY_FUNCTION__).warning().nospace()-
511 << "Test '" << QDir::toNativeSeparators(path) << "' window not active after requestActivate().";-
512 }
never executed: end of block
0
513 if (view.isExposed()
view.isExposed()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
FALSEnever evaluated
) {
0-16
514 QTestRootObject::instance()->setWindowShown(true);-
515 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
else {
16
516 QMessageLogger(__FILE__, 582, __PRETTY_FUNCTION__).warning().nospace()-
517 << "Test '" << QDir::toNativeSeparators(path) << "' window was never exposed! "-
518 << "If the test case was expecting windowShown, it will hang.";-
519 }
never executed: end of block
0
520 if (!QTestRootObject::instance()->hasQuit
!QTestRootObje...nce()->hasQuitDescription
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
&& QTestRootObject::instance()->hasTestCase()
QTestRootObjec...>hasTestCase()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-16
521 eventLoop.exec();
never executed: eventLoop.exec();
0
522 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
16
523 }
executed 32 times by 4 tests: end of block
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
32
524-
525-
526 QuickTestResult::setProgramName(nullptr);-
527 delete app;-
528-
529-
530 if (!commandLineTestFunctions.isEmpty()
!commandLineTe...ions.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_testfiltering
FALSEevaluated 14 times by 4 tests
Evaluated by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
) {
4-14
531 QMessageLogger(__FILE__, 597, __PRETTY_FUNCTION__).warning() << "Could not find the following test functions:";-
532 for (const QString &functionName : qAsConst(commandLineTestFunctions))-
533 QMessageLogger(__FILE__, 599, __PRETTY_FUNCTION__).warning(" %s()", QtPrivate::asString(functionName).toUtf8().constData());
executed 4 times by 1 test: QMessageLogger(__FILE__, 599, __PRETTY_FUNCTION__).warning(" %s()", QtPrivate::asString(functionName).toUtf8().constData());
Executed by:
  • tst_testfiltering
4
534 return
executed 4 times by 1 test: return commandLineTestFunctions.count();
Executed by:
  • tst_testfiltering
commandLineTestFunctions.count();
executed 4 times by 1 test: return commandLineTestFunctions.count();
Executed by:
  • tst_testfiltering
4
535 }-
536-
537-
538 return
executed 14 times by 4 tests: return QuickTestResult::exitCode();
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
QuickTestResult::exitCode();
executed 14 times by 4 tests: return QuickTestResult::exitCode();
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
14
539}-
540-
541-
542-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0