35 Q_PROPERTY(QString testCaseName READ testCaseName WRITE setTestCaseName NOTIFY testCaseNameChanged)
36 Q_PROPERTY(QString functionName READ functionName WRITE setFunctionName NOTIFY functionNameChanged)
37 Q_PROPERTY(QString dataTag READ dataTag WRITE setDataTag NOTIFY dataTagChanged)
38 Q_PROPERTY(
bool failed READ isFailed)
39 Q_PROPERTY(
bool skipped READ isSkipped WRITE setSkipped NOTIFY skippedChanged)
40 Q_PROPERTY(
int passCount READ passCount)
41 Q_PROPERTY(
int failCount READ failCount)
42 Q_PROPERTY(
int skipCount READ skipCount)
43 Q_PROPERTY(QStringList functionsToRun READ functionsToRun)
44 Q_PROPERTY(QStringList tagsToRun READ tagsToRun)
46 QML_NAMED_ELEMENT(TestResult)
47 QML_ADDED_IN_VERSION(1, 0)
50 QuickTestResult(QObject *parent =
nullptr);
51 ~QuickTestResult() override;
56 RepeatUntilValidMeasurement,
61 QString testCaseName()
const;
62 void setTestCaseName(
const QString &name);
64 QString functionName()
const;
65 void setFunctionName(
const QString &name);
67 QString dataTag()
const;
68 void setDataTag(
const QString &tag);
70 bool isFailed()
const;
72 bool isSkipped()
const;
73 void setSkipped(
bool skip);
75 int passCount()
const;
76 int failCount()
const;
77 int skipCount()
const;
79 QStringList functionsToRun()
const;
80 QStringList tagsToRun()
const;
89 void clearTestTable();
91 void finishTestData();
92 void finishTestDataCleanup();
93 void finishTestFunction();
95 void stringify(QQmlV4FunctionPtr args);
97 void fail(
const QString &message,
const QUrl &location,
int line);
98 bool verify(
bool success,
const QString &message,
99 const QUrl &location,
int line);
100 bool compare(
bool success,
const QString &message,
101 const QVariant &val1,
const QVariant &val2,
102 const QUrl &location,
int line);
103 bool fuzzyCompare(
const QVariant &actual,
const QVariant &expected, qreal delta);
104 void skip(
const QString &message,
const QUrl &location,
int line);
105 bool expectFail(
const QString &tag,
const QString &comment,
106 const QUrl &location,
int line);
107 bool expectFailContinue(
const QString &tag,
const QString &comment,
108 const QUrl &location,
int line);
109 void warn(
const QString &message,
const QUrl &location,
int line);
111 void ignoreWarning(
const QJSValue &message);
112 Q_REVISION(6, 3)
void failOnWarning(
const QJSValue &message);
116 bool waitForRendering(QQuickItem *item,
int timeout = 5000);
118 void startMeasurement();
121 bool measurementAccepted();
122 bool needsMoreMeasurements();
124 void startBenchmark(RunMode runMode,
const QString &tag);
125 bool isBenchmarkDone()
const;
126 void nextBenchmark();
127 void stopBenchmark();
129 QObject *grabImage(QQuickItem *item);
131 Q_REVISION(1, 1) QObject *findChild(QObject *parent,
const QString &objectName);
133 Q_REVISION(1, 13)
bool isPolishScheduled(QObject *itemOrWindow)
const;
134 Q_REVISION(6, 5)
bool waitForPolish(QObject *itemOrWindow,
int timeout)
const;
138 static void parseArgs(
int argc,
char *argv[]);
139 static void setProgramName(
const char *name);
140 static void setCurrentAppname(
const char *appname);
141 static int exitCode();
144 void programNameChanged();
145 void testCaseNameChanged();
146 void functionNameChanged();
147 void dataTagChanged();
148 void skippedChanged();
151 QScopedPointer<QuickTestResultPrivate> d_ptr;
153 Q_DECLARE_PRIVATE(QuickTestResult)
154 Q_DISABLE_COPY(QuickTestResult)