Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
quicktestresult.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 Crimson AS <info@crimson.no>
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "quicktestresult_p.h"
6#include "quicktest.h"
7#include "quicktest_p.h"
8#include <QtTest/qtestcase.h>
9#include <QtTest/qtestsystem.h>
10#include <QtTest/private/qtestblacklist_p.h>
11#include <QtTest/private/qtestresult_p.h>
12#include <QtTest/private/qtesttable_p.h>
13#include <QtTest/private/qtestlog_p.h>
14#include "qtestoptions_p.h"
15#include <QtTest/qbenchmark.h>
16#include <QtTest/private/qbenchmark_p.h>
17#include <QtCore/qset.h>
18#include <QtCore/qmap.h>
19#include <QtCore/qbytearray.h>
20#include <QtCore/qcoreapplication.h>
21#include <QtCore/qdatetime.h>
22#include <QtCore/qdebug.h>
23#include <QtCore/QUrl>
24#include <QtCore/QDir>
25#if QT_CONFIG(regularexpression)
26#include <QtCore/qregularexpression.h>
27#endif
28#include <QtQuick/qquickwindow.h>
29#include <QtGui/qvector3d.h>
30#include <QtGui/qimagewriter.h>
31#include <QtQml/private/qqmlglobal_p.h>
32#include <QtQml/QQmlEngine>
33#include <QtQml/QQmlContext>
34#include <private/qv4qobjectwrapper_p.h>
35
36#include <algorithm>
37
39
40static const char *globalProgramName = nullptr;
41static bool loggingStarted = false;
43
45{
47
48 Q_PROPERTY(int width READ width CONSTANT)
49 Q_PROPERTY(int height READ height CONSTANT)
50 Q_PROPERTY(QSize size READ size CONSTANT)
51
52public:
55 , m_image(img)
56 {
57 }
58
60
61public Q_SLOTS:
62 int red(int x, int y) const
63 {
64 return pixel(x, y).value<QColor>().red();
65 }
66
67 int green(int x, int y) const
68 {
69 return pixel(x, y).value<QColor>().green();
70 }
71
72 int blue(int x, int y) const
73 {
74 return pixel(x, y).value<QColor>().blue();
75 }
76
77 int alpha(int x, int y) const
78 {
79 return pixel(x, y).value<QColor>().alpha();
80 }
81
82 QVariant pixel(int x, int y) const
83 {
84 if (m_image.isNull()
85 || x >= m_image.width()
86 || y >= m_image.height()
87 || x < 0
88 || y < 0
89 || x * y >= m_image.width() * m_image.height())
90 return QVariant();
91
92 return QColor::fromRgba(m_image.pixel(QPoint(x, y)));
93 }
94
96 {
97 if (!other)
98 return m_image.isNull();
99
100 return m_image == other->m_image;
101 }
102
103 void save(const QString &filePath)
104 {
105 QImageWriter writer(filePath);
106 if (!writer.write(m_image)) {
109 v4->throwError(QStringLiteral("Can't save to %1: %2").arg(filePath, writer.errorString()));
110 }
111 }
112
113public:
114 int width() const
115 {
116 return m_image.width();
117 }
118
119 int height() const
120 {
121 return m_image.height();
122 }
123
124 QSize size() const
125 {
126 return m_image.size();
127 }
128
129private:
130 QImage m_image;
131};
132
134{
135public:
137 : table(nullptr)
140 , iterCount(0)
141 {
142 }
144 {
145 delete table;
146 delete benchmarkIter;
147 delete benchmarkData;
148 }
149
151
160};
161
163{
164 QByteArray bstr = str.toUtf8();
165 return *(internedStrings.insert(bstr));
166}
167
170{
173}
174
176{
177}
178
188{
189 Q_D(const QuickTestResult);
190 return d->testCaseName;
191}
192
194{
195 Q_D(QuickTestResult);
196 d->testCaseName = name;
198}
199
210{
211 Q_D(const QuickTestResult);
212 return d->functionName;
213}
214
216{
217 Q_D(QuickTestResult);
218 if (!name.isEmpty()) {
219 if (d->testCaseName.isEmpty()) {
221 (d->intern(name).constData());
222 } else {
223 QString fullName = d->testCaseName + QLatin1String("::") + name;
225 (d->intern(fullName).constData());
226 QTestPrivate::checkBlackLists(fullName.toUtf8().constData(), nullptr);
227 }
228 } else {
230 }
231 d->functionName = name;
233}
234
242{
243 const char *tag = QTestResult::currentDataTag();
244 if (tag)
245 return QString::fromUtf8(tag);
246 else
247 return QString();
248}
249
251{
252 if (!tag.isEmpty()) {
253 QTestData *data = &(QTest::newRow(tag.toUtf8().constData()));
255 QTestPrivate::checkBlackLists((testCaseName() + QLatin1String("::") + functionName()).toUtf8().constData(), tag.toUtf8().constData());
257 } else {
259 }
260}
261
273{
275}
276
286{
288}
289
291{
293 if (!skip)
296}
297
306{
307 return QTestLog::passCount();
308}
309
318{
319 return QTestLog::failCount();
320}
321
330{
331 return QTestLog::skipCount();
332}
333
340{
342}
343
350{
351 return QTest::testTags;
352}
353
360{
361 if (!globalProgramName) // Only if run via qmlviewer.
363}
364
374{
375 // The program name is used for logging headers and footers if it
376 // is set. Otherwise the test case name is used.
377 if (loggingStarted)
378 return;
380 loggingStarted = true;
381}
382
391{
392 Q_D(QuickTestResult);
394 return; // Logging will be stopped by setProgramName(0).
395 QTestResult::setCurrentTestObject(d->intern(d->testCaseName).constData());
397}
398
400{
401 Q_D(QuickTestResult);
402 delete d->table;
403 d->table = new QTestTable;
404 //qmltest does not really need the column for data driven test
405 //add this to avoid warnings.
406 d->table->addColumn(qMetaTypeId<QString>(), "qmltest_dummy_data_column");
407}
408
410{
411 Q_D(QuickTestResult);
412 delete d->table;
413 d->table = nullptr;
414}
415
417{
419}
420
422{
424}
425
427{
429}
430
432{
433 if (location.isLocalFile()) // Use QUrl's logic for Windows drive letters.
434 return QDir::toNativeSeparators(location.toLocalFile());
435 return location.toString();
436}
437
439 (const QString &message, const QUrl &location, int line)
440{
441 QTestResult::addFailure(message.toUtf8().constData(),
442 qtestFixUrl(location).toLatin1().constData(), line);
443}
444
446 (bool success, const QString &message, const QUrl &location, int line)
447{
448 if (!success && message.isEmpty()) {
450 (success, "verify()", "",
451 qtestFixUrl(location).toLatin1().constData(), line);
452 } else {
454 (success, message.toUtf8().constData(), "",
455 qtestFixUrl(location).toLatin1().constData(), line);
456 }
457}
458
460{
461 if (actual.userType() == QMetaType::QColor || expected.userType() == QMetaType::QColor) {
462 if (!actual.canConvert(QMetaType(QMetaType::QColor))
463 || !expected.canConvert(QMetaType(QMetaType::QColor))) {
464 return false;
465 }
466
467 //fuzzy color comparison
468 QColor act;
469 QColor exp;
470 bool ok(false);
471
473 if (!ok)
474 return false;
475 act = var.value<QColor>();
476
478 if (!ok)
479 return false;
480 exp = var.value<QColor>();
481
482 return ( qAbs(act.red() - exp.red()) <= delta
483 && qAbs(act.green() - exp.green()) <= delta
484 && qAbs(act.blue() - exp.blue()) <= delta
485 && qAbs(act.alpha() - exp.alpha()) <= delta);
486 } else {
487 //number comparison
488 bool ok = true;
489 qreal act = actual.toFloat(&ok);
490 if (!ok)
491 return false;
492
493 qreal exp = expected.toFloat(&ok);
494 if (!ok)
495 return false;
496
497 return (qAbs(act - exp) <= delta);
498 }
499
500 return false;
501}
502
504{
505 if (args->length() < 1)
506 args->setReturnValue(QV4::Encode::null());
507
508 QV4::Scope scope(args->v4engine());
509 QV4::ScopedValue value(scope, (*args)[0]);
510
512
513 //Check for Object Type
514 if (value->isObject()
515 && !value->as<QV4::FunctionObject>()
516 && !value->as<QV4::ArrayObject>()) {
518 if (v.isValid()) {
519 switch (v.userType()) {
520 case QMetaType::QVector3D:
521 {
522 QVector3D v3d = v.value<QVector3D>();
523 result = QString::fromLatin1("Qt.vector3d(%1, %2, %3)").arg(v3d.x()).arg(v3d.y()).arg(v3d.z());
524 break;
525 }
526 case QMetaType::QUrl:
527 {
528 QUrl url = v.value<QUrl>();
529 result = QString::fromLatin1("Qt.url(%1)").arg(url.toString());
530 break;
531 }
532 case QMetaType::QDateTime:
533 {
534 QDateTime dt = v.value<QDateTime>();
535 result = dt.toString(Qt::ISODateWithMs);
536 break;
537 }
538 default:
539 result = v.toString();
540 }
541
542 } else {
543 result = QLatin1String("Object");
544 }
545 }
546
547 if (result.isEmpty()) {
548 QString tmp = value->toQStringNoThrow();
549 if (value->as<QV4::ArrayObject>())
550 result += QLatin1Char('[') + tmp + QLatin1Char(']');
551 else
552 result.append(tmp);
553 }
554
555 args->setReturnValue(QV4::Encode(args->v4engine()->newString(result)));
556}
557
559 (bool success, const QString &message,
560 const QVariant &val1, const QVariant &val2,
561 const QUrl &location, int line)
562{
564 (success, message.toUtf8().constData(),
567 "", "",
568 qtestFixUrl(location).toLatin1().constData(), line);
569}
570
572 (const QString &message, const QUrl &location, int line)
573{
574 QTestResult::addSkip(message.toUtf8().constData(),
575 qtestFixUrl(location).toLatin1().constData(), line);
577}
578
580 (const QString &tag, const QString &comment, const QUrl &location, int line)
581{
583 (tag.toLatin1().constData(),
585 QTest::Abort, qtestFixUrl(location).toLatin1().constData(), line);
586}
587
589 (const QString &tag, const QString &comment, const QUrl &location, int line)
590{
592 (tag.toLatin1().constData(),
593 QTest::toString(comment.toUtf8().constData()),
594 QTest::Continue, qtestFixUrl(location).toLatin1().constData(), line);
595}
596
598{
599 QTestLog::warn(message.toUtf8().constData(), qtestFixUrl(location).toLatin1().constData(), line);
600}
601
603{
604 if (message.isRegExp()) {
605#if QT_CONFIG(regularexpression)
606 QTestLog::ignoreMessage(QtWarningMsg, qjsvalue_cast<QRegularExpression>(message));
607#endif
608 } else {
609 QTestLog::ignoreMessage(QtWarningMsg, message.toString().toUtf8());
610 }
611}
612
613void QuickTestResult::failOnWarning(const QJSValue &message)
614{
615 if (message.isRegExp()) {
616#if QT_CONFIG(regularexpression)
617 QTestLog::failOnWarning(qjsvalue_cast<QRegularExpression>(message));
618#endif
619 } else {
620 QTestLog::failOnWarning(message.toString().toUtf8());
621 }
622}
623
625{
626 QTest::qWait(ms);
627}
628
630{
631 QTest::qSleep(ms);
632}
633
635{
636 Q_ASSERT(item);
637
638 return qWaitForSignal(item->window(), SIGNAL(frameSwapped()), timeout);
639}
640
642{
643 Q_D(QuickTestResult);
644 delete d->benchmarkData;
645 d->benchmarkData = new QBenchmarkTestMethodData();
646 QBenchmarkTestMethodData::current = d->benchmarkData;
648 d->resultsList.clear();
649}
650
652{
654}
655
657{
658 Q_D(QuickTestResult);
661 if (results.isEmpty())
662 return; // shouldn't happen
663 if (d->iterCount > -1) // iteration -1 is the warmup iteration.
664 d->resultsList.append(results);
665
666 if (QBenchmarkGlobalData::current->verboseOutput) {
667 if (d->iterCount == -1) {
668 qDebug() << "warmup stage result :" << results.first().measurement.value;
669 } else {
670 qDebug() << "accumulation stage result:" << results.first().measurement.value;
671 }
672 }
673}
674
676{
678}
679
681{
682 const int count = container.size();
683 if (count == 0)
684 return {};
685
686 if (count == 1)
687 return container.at(0);
688
689 QList<QList<QBenchmarkResult>> containerCopy = container;
690 std::sort(containerCopy.begin(), containerCopy.end(),
692 return a.first() < b.first();
693 });
694
695 const int middle = count / 2;
696
697 // ### handle even-sized containers here by doing an aritmetic mean of the two middle items.
698 return containerCopy.at(middle);
699}
700
702{
703 Q_D(QuickTestResult);
704 ++(d->iterCount);
706 return true;
707 if (QBenchmarkTestMethodData::current->resultsAccepted())
709 return false;
710}
711
713{
718
719 Q_D(QuickTestResult);
720 delete d->benchmarkIter;
721 d->benchmarkIter = new QTest::QBenchmarkIterationController
723}
724
726{
727 Q_D(const QuickTestResult);
728 if (d->benchmarkIter)
729 return d->benchmarkIter->isDone();
730 else
731 return true;
732}
733
735{
736 Q_D(QuickTestResult);
737 if (d->benchmarkIter)
738 d->benchmarkIter->next();
739}
740
742{
743 Q_D(QuickTestResult);
744 delete d->benchmarkIter;
745 d->benchmarkIter = nullptr;
746}
747
749{
750 if (item && item->window()) {
752 QImage grabbed = window->grabWindow();
753 const auto dpi = grabbed.devicePixelRatio();
754 QRectF rf(item->x() * dpi, item->y() * dpi, item->width() * dpi, item->height() * dpi);
755 rf = rf.intersected(QRectF(0, 0, grabbed.width(), grabbed.height()));
756 QObject *o = new QuickTestImageObject(grabbed.copy(rf.toAlignedRect()));
758 return o;
759 }
760 return nullptr;
761}
762
764{
765 return parent ? parent->findChild<QObject*>(objectName) : 0;
766}
767
768bool QuickTestResult::isPolishScheduled(QObject *itemOrWindow) const
769{
770 if (auto item = qobject_cast<QQuickItem*>(itemOrWindow))
772
773 if (auto window = qobject_cast<QQuickWindow*>(itemOrWindow))
775
776 qmlWarning(this) << "isPolishScheduled() expects either an Item or Window, but got"
777 << QDebug::toString(itemOrWindow);
778 return false;
779}
780
781bool QuickTestResult::waitForPolish(QObject *itemOrWindow, int timeout) const
782{
783 if (auto item = qobject_cast<QQuickItem*>(itemOrWindow))
785
786 if (auto window = qobject_cast<QQuickWindow*>(itemOrWindow))
788
789 qmlWarning(this) << "waitForItemPolish() expects either an Item or Window, but got"
790 << QDebug::toString(itemOrWindow);
791 return false;
792}
793
794namespace QTest {
795 void qtest_qParseArgs(int argc, char *argv[], bool qml);
796};
797
798void QuickTestResult::parseArgs(int argc, char *argv[])
799{
802 QTest::qtest_qParseArgs(argc, argv, true);
803}
804
806{
807 if (name) {
810 } else if (!name && loggingStarted) {
814 }
817}
818
819void QuickTestResult::setCurrentAppname(const char *appname)
820{
822}
823
825{
826#if defined(QTEST_NOEXITCODE)
827 return 0;
828#else
829 // make sure our exit code is never going above 127
830 // since that could wrap and indicate 0 test fails
831 return qMin(QTestLog::failCount(), 127);
832#endif
833}
834
836
837#include "quicktestresult.moc"
838#include "moc_quicktestresult_p.cpp"
QBenchmarkContext context
QBenchmarkMeasurerBase * measurer
static QBenchmarkGlobalData * current
static QBenchmarkTestMethodData * current
QList< QBenchmarkResult > results
\inmodule QtCore
Definition qbytearray.h:57
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
Definition qbytearray.h:122
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
static QColor fromRgba(QRgb rgba) noexcept
Static convenience function that returns a QColor constructed from the given QRgb value rgba.
Definition qcolor.cpp:2385
int alpha() const noexcept
Returns the alpha color component of this color.
Definition qcolor.cpp:1466
int red() const noexcept
Returns the red color component of this color.
Definition qcolor.cpp:1528
int blue() const noexcept
Returns the blue color component of this color.
Definition qcolor.cpp:1583
int green() const noexcept
Returns the green color component of this color.
Definition qcolor.cpp:1555
\inmodule QtCore\reentrant
Definition qdatetime.h:257
static QString toNativeSeparators(const QString &pathName)
Definition qdir.cpp:929
qreal y() const
This convenience function is equivalent to calling pos().y().
QGraphicsWidget * window() const
qreal x() const
This convenience function is equivalent to calling pos().x().
The QImageWriter class provides a format independent interface for writing images to files or other d...
QString errorString() const
Returns a human readable description of the last error that occurred.
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
\inmodule QtGui
Definition qimage.h:37
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
int width() const
Returns the width of the image.
int height() const
Returns the height of the image.
qreal devicePixelRatio() const
Returns the device pixel ratio for the image.
Definition qimage.cpp:1460
QV4::ExecutionEngine * handle() const
Definition qjsengine.h:292
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
QString toString() const
Returns the string value of this QJSValue, as defined in \l{ECMA-262} section 9.8,...
Definition qjsvalue.cpp:473
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
bool isEmpty() const noexcept
Definition qlist.h:390
T & first()
Definition qlist.h:628
iterator end()
Definition qlist.h:609
qsizetype length() const noexcept
Definition qlist.h:388
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
iterator begin()
Definition qlist.h:608
\inmodule QtCore
Definition qmetatype.h:320
\inmodule QtCore
Definition qobject.h:90
T findChild(const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
Returns the child of this object that can be cast into type T and that is called name,...
Definition qobject.h:133
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
\inmodule QtCore\reentrant
Definition qpoint.h:23
virtual QVariant colorFromString(const QString &, bool *)
QQmlEngine * engine() const
Return the context's QQmlEngine, or \nullptr if the context has no QQmlEngine or the QQmlEngine was d...
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
static void setContextForObject(QObject *, QQmlContext *)
Sets the QQmlContext for the object to context.
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtCore\reentrant
Definition qrect.h:483
QRect toAlignedRect() const noexcept
Definition qrect.cpp:2330
QRectF intersected(const QRectF &other) const noexcept
Definition qrect.h:833
Definition qset.h:18
iterator insert(const T &value)
Definition qset.h:155
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QByteArray toLatin1() const &
Definition qstring.h:559
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5710
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5857
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8606
QByteArray toUtf8() const &
Definition qstring.h:563
static int passCount()
Definition qtestlog.cpp:642
static int failCount()
Definition qtestlog.cpp:647
static void startLogging()
Definition qtestlog.cpp:480
static void addBenchmarkResults(const QList< QBenchmarkResult > &result)
Definition qtestlog.cpp:474
static void stopLogging()
Definition qtestlog.cpp:489
static int skipCount()
Definition qtestlog.cpp:652
static void warn(const char *msg, const char *file, int line)
Definition qtestlog.cpp:572
static void ignoreMessage(QtMsgType type, const char *msg)
Definition qtestlog.cpp:598
static void finishedCurrentTestDataCleanup()
This function is called after completing each test function, including test functions that are not da...
static void finishedCurrentTestData()
This function is called after completing each test function, including test functions that are not da...
static bool expectFail(const char *dataIndex, const char *comment, QTest::TestFailMode mode, const char *file, int line)
static bool verify(bool statement, const char *statementStr, const char *extraInfo, const char *file, int line)
static bool currentTestFailed()
static void setSkipCurrentTest(bool value)
static void setCurrentAppName(const char *appName)
static void reset()
static void setCurrentTestFunction(const char *func)
static void setBlacklistCurrentTest(bool b)
static void setCurrentTestObject(const char *name)
static const char * currentDataTag()
static bool compare(bool success, const char *failureMsg, char *val1, char *val2, const char *actual, const char *expected, const char *file, int line)
static void addFailure(const char *message, const char *file=nullptr, int line=0)
static bool skipCurrentTest()
static void finishedCurrentTestFunction()
This function is called after completing each test function, including test functions that are data-d...
static void setCurrentTestData(QTestData *data)
static void addSkip(const char *message, const char *file, int line)
\inmodule QtCore
Definition qurl.h:94
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
Definition qurl.cpp:2828
\inmodule QtCore
Definition qvariant.h:64
T value() const &
Definition qvariant.h:511
int userType() const
Definition qvariant.h:336
float toFloat(bool *ok=nullptr) const
Returns the variant as a float if the variant has userType() \l QMetaType::Double,...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
bool canConvert(QMetaType targetType) const
Definition qvariant.h:342
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
constexpr float y() const noexcept
Returns the y coordinate of this point.
Definition qvectornd.h:671
constexpr float x() const noexcept
Returns the x coordinate of this point.
Definition qvectornd.h:670
constexpr float z() const noexcept
Returns the z coordinate of this point.
Definition qvectornd.h:672
bool equals(QuickTestImageObject *other) const
int red(int x, int y) const
QVariant pixel(int x, int y) const
void save(const QString &filePath)
int green(int x, int y) const
QuickTestImageObject(const QImage &img, QObject *parent=nullptr)
int alpha(int x, int y) const
int blue(int x, int y) const
QByteArray intern(const QString &str)
QSet< QByteArray > internedStrings
QList< QList< QBenchmarkResult > > resultsList
QTest::QBenchmarkIterationController * benchmarkIter
QBenchmarkTestMethodData * benchmarkData
void warn(const QString &message, const QUrl &location, int line)
void functionNameChanged()
void setFunctionName(const QString &name)
QStringList functionsToRun
bool verify(bool success, const QString &message, const QUrl &location, int line)
bool isBenchmarkDone() const
bool isSkipped() const
\qmlproperty bool TestResult::skipped
const QString & objectName
bool expectFailContinue(const QString &tag, const QString &comment, const QUrl &location, int line)
void reset()
\qmlmethod TestResult::reset()
void setTestCaseName(const QString &name)
static void setCurrentAppname(const char *appname)
bool compare(bool success, const QString &message, const QVariant &val1, const QVariant &val2, const QUrl &location, int line)
QuickTestResult(QObject *parent=nullptr)
QStringList tagsToRun
void stopLogging()
\qmlmethod TestResult::stopLogging()
static void setProgramName(const char *name)
bool isFailed() const
\qmlproperty bool TestResult::failed
void ignoreWarning(const QJSValue &message)
void skippedChanged()
void testCaseNameChanged()
void startBenchmark(RunMode runMode, const QString &tag)
void startLogging()
\qmlmethod TestResult::startLogging()
void fail(const QString &message, const QUrl &location, int line)
void dataTagChanged()
bool expectFail(const QString &tag, const QString &comment, const QUrl &location, int line)
void stringify(QQmlV4Function *args)
~QuickTestResult() override
static void parseArgs(int argc, char *argv[])
bool fuzzyCompare(const QVariant &actual, const QVariant &expected, qreal delta)
bool waitForRendering(QQuickItem *item, int timeout=5000)
void setDataTag(const QString &tag)
QObject * grabImage(QQuickItem *item)
static int exitCode()
void skip(const QString &message, const QUrl &location, int line)
void setSkipped(bool skip)
QJSValue expected
Definition qjsengine.cpp:12
QString str
[2]
Q_QUICK_TEST_EXPORT bool qWaitForPolish(const QQuickItem *item, int timeout=defaultTimeout)
Q_QUICK_TEST_EXPORT bool qIsPolishScheduled(const QQuickItem *item)
Definition quicktest.cpp:73
Combined button and popup list for selecting options.
void checkBlackLists(const char *slot, const char *data, const char *global)
Q_TESTLIB_EXPORT QTestData & newRow(const char *dataTag)
Appends a new row to the current test data.
Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool qml)
char * toString(const MyPoint &point)
Q_TESTLIB_EXPORT QStringList testFunctions
Q_CORE_EXPORT void qSleep(int ms)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_TESTLIB_EXPORT QStringList testTags
Q_CORE_EXPORT void qWait(int ms)
This is an overloaded member function, provided for convenience. It differs from the above function o...
@ ISODateWithMs
AudioChannelLayoutTag tag
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qDebug
[1]
Definition qlogging.h:160
@ QtWarningMsg
Definition qlogging.h:31
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
constexpr T qAbs(const T &t)
Definition qnumeric.h:328
#define SIGNAL(a)
Definition qobjectdefs.h:52
GLint location
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLbitfield GLuint64 timeout
[4]
GLint GLsizei width
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLint y
GLbyte GLbyte blue
Definition qopenglext.h:385
GLint void * img
Definition qopenglext.h:233
GLuint64EXT * result
[6]
GLfloat GLfloat GLfloat alpha
Definition qopenglext.h:418
GLbyte green
Definition qopenglext.h:385
GLenum GLenum GLsizei void * table
QQmlContext * qmlContext(const QObject *obj)
Definition qqml.cpp:71
Q_AUTOTEST_EXPORT QQmlColorProvider * QQml_colorProvider(void)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
Definition qquickitem.h:483
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
SSL_CTX int(*) void arg)
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define QStringLiteral(str)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define emit
double qreal
Definition qtypes.h:92
bool qWaitForSignal(QObject *obj, const char *signal, int timeout)
#define Q_QUICK_TEST_EXPORT
static QBenchmarkGlobalData globalBenchmarkData
static QString qtestFixUrl(const QUrl &location)
static QList< QBenchmarkResult > qMedian(const QList< QList< QBenchmarkResult > > &container)
static bool loggingStarted
static QT_BEGIN_NAMESPACE const char * globalProgramName
QUrl url("example.com")
[constructor-url-reference]
QObject::connect nullptr
QSharedPointer< T > other(t)
[5]
QGraphicsItem * item
aWidget window() -> setWindowTitle("New Window Title")
[2]
QJSValueList args
QJSValue fullName
QJSEngine engine
[0]
QGraphicsSvgItem * red
\inmodule QtCore \reentrant
Definition qchar.h:17
static constexpr ReturnedValue null()
ReturnedValue throwError(const Value &value)
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
const T * as() const
Definition qv4value_p.h:132
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent