OpenCoverage

quicktestresult_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qmltest/quicktestresult_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the test suite of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QUICKTESTRESULT_P_H-
41#define QUICKTESTRESULT_P_H-
42-
43//-
44// W A R N I N G-
45// --------------
46//-
47// This file is not part of the Qt API. It exists purely as an-
48// implementation detail. This header file may change from version to-
49// version without notice, or even be removed.-
50//-
51// We mean it.-
52//-
53-
54#include <QtQuickTest/quicktestglobal.h>-
55#include <QtCore/qobject.h>-
56#include <QtCore/qstring.h>-
57#include <QtCore/qstringlist.h>-
58#include <QtCore/qscopedpointer.h>-
59#include <QtQuick/qquickitem.h>-
60#include <QtQml/private/qv8engine_p.h>-
61-
62QT_BEGIN_NAMESPACE-
63-
64class QUrl;-
65class QuickTestResultPrivate;-
66-
67class Q_QUICK_TEST_EXPORT QuickTestResult : public QObject-
68{-
69 Q_OBJECT-
70 Q_PROPERTY(QString testCaseName READ testCaseName WRITE setTestCaseName NOTIFY testCaseNameChanged)-
71 Q_PROPERTY(QString functionName READ functionName WRITE setFunctionName NOTIFY functionNameChanged)-
72 Q_PROPERTY(QString dataTag READ dataTag WRITE setDataTag NOTIFY dataTagChanged)-
73 Q_PROPERTY(bool failed READ isFailed)-
74 Q_PROPERTY(bool skipped READ isSkipped WRITE setSkipped NOTIFY skippedChanged)-
75 Q_PROPERTY(int passCount READ passCount)-
76 Q_PROPERTY(int failCount READ failCount)-
77 Q_PROPERTY(int skipCount READ skipCount)-
78 Q_PROPERTY(QStringList functionsToRun READ functionsToRun)-
79public:-
80 QuickTestResult(QObject *parent = nullptr);-
81 ~QuickTestResult() override;-
82-
83 // Values must match QBenchmarkIterationController::RunMode.-
84 enum RunMode-
85 {-
86 RepeatUntilValidMeasurement,-
87 RunOnce-
88 };-
89 Q_ENUM(RunMode)-
90-
91 QString testCaseName() const;-
92 void setTestCaseName(const QString &name);-
93-
94 QString functionName() const;-
95 void setFunctionName(const QString &name);-
96-
97 QString dataTag() const;-
98 void setDataTag(const QString &tag);-
99-
100 bool isFailed() const;-
101-
102 bool isSkipped() const;-
103 void setSkipped(bool skip);-
104-
105 int passCount() const;-
106 int failCount() const;-
107 int skipCount() const;-
108-
109 QStringList functionsToRun() const;-
110-
111public Q_SLOTS:-
112 void reset();-
113-
114 void startLogging();-
115 void stopLogging();-
116-
117 void initTestTable();-
118 void clearTestTable();-
119-
120 void finishTestData();-
121 void finishTestDataCleanup();-
122 void finishTestFunction();-
123-
124 void stringify(QQmlV4Function *args);-
125-
126 void fail(const QString &message, const QUrl &location, int line);-
127 bool verify(bool success, const QString &message,-
128 const QUrl &location, int line);-
129 bool compare(bool success, const QString &message,-
130 const QVariant &val1, const QVariant &val2,-
131 const QUrl &location, int line);-
132 bool fuzzyCompare(const QVariant &actual, const QVariant &expected, qreal delta);-
133 void skip(const QString &message, const QUrl &location, int line);-
134 bool expectFail(const QString &tag, const QString &comment,-
135 const QUrl &location, int line);-
136 bool expectFailContinue(const QString &tag, const QString &comment,-
137 const QUrl &location, int line);-
138 void warn(const QString &message, const QUrl &location, int line);-
139-
140 void ignoreWarning(const QJSValue &message);-
141-
142 void wait(int ms);-
143 void sleep(int ms);-
144 bool waitForRendering(QQuickItem *item, int timeout = 5000);-
145-
146 void startMeasurement();-
147 void beginDataRun();-
148 void endDataRun();-
149 bool measurementAccepted();-
150 bool needsMoreMeasurements();-
151-
152 void startBenchmark(RunMode runMode, const QString &tag);-
153 bool isBenchmarkDone() const;-
154 void nextBenchmark();-
155 void stopBenchmark();-
156-
157 QObject *grabImage(QQuickItem *item);-
158-
159 Q_REVISION(1) QObject *findChild(QObject *parent, const QString &objectName);-
160-
161public:-
162 // Helper functions for the C++ main() shell.-
163 static void parseArgs(int argc, char *argv[]);-
164 static void setProgramName(const char *name);-
165 static void setCurrentAppname(const char *appname);-
166 static int exitCode();-
167-
168Q_SIGNALS:-
169 void programNameChanged();-
170 void testCaseNameChanged();-
171 void functionNameChanged();-
172 void dataTagChanged();-
173 void skippedChanged();-
174-
175private:-
176 QScopedPointer<QuickTestResultPrivate> d_ptr;-
177-
178 Q_DECLARE_PRIVATE(QuickTestResult)
executed 340 times by 4 tests: return reinterpret_cast<QuickTestResultPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
executed 384 times by 2 tests: return reinterpret_cast<const QuickTestResultPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
340-384
179 Q_DISABLE_COPY(QuickTestResult)-
180};-
181-
182QT_END_NAMESPACE-
183-
184#endif-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0