![]() |
Qt 6.x
The Qt SDK
|
#include <quicktestresult_p.h>
Public Types | |
enum | RunMode { RepeatUntilValidMeasurement , RunOnce } |
Signals | |
void | programNameChanged () |
void | testCaseNameChanged () |
void | functionNameChanged () |
void | dataTagChanged () |
void | skippedChanged () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QuickTestResult (QObject *parent=nullptr) | |
~QuickTestResult () override | |
QString | testCaseName () const |
\qmlproperty string TestResult::testCaseName | |
void | setTestCaseName (const QString &name) |
QString | functionName () const |
\qmlproperty string TestResult::functionName | |
void | setFunctionName (const QString &name) |
QString | dataTag () const |
\qmlproperty string TestResult::dataTag | |
void | setDataTag (const QString &tag) |
bool | isFailed () const |
\qmlproperty bool TestResult::failed | |
bool | isSkipped () const |
\qmlproperty bool TestResult::skipped | |
void | setSkipped (bool skip) |
int | passCount () const |
\qmlproperty int TestResult::passCount | |
int | failCount () const |
\qmlproperty int TestResult::failCount | |
int | skipCount () const |
\qmlproperty int TestResult::skipCount | |
QStringList | functionsToRun () const |
\qmlproperty list<string> TestResult::functionsToRun | |
QStringList | tagsToRun () const |
\qmlproperty list<string> TestResult::tagsToRun | |
Q_REVISION (1, 13) bool isPolishScheduled(QObject *itemOrWindow) const | |
Q_REVISION (6, 5) bool waitForPolish(QObject *itemOrWindow | |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
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, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Static Public Member Functions | |
static void | parseArgs (int argc, char *argv[]) |
static void | setProgramName (const char *name) |
static void | setCurrentAppname (const char *appname) |
static int | exitCode () |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Public Attributes | |
const QString & | objectName |
int timeout | const |
Properties | |
QString | testCaseName |
QString | functionName |
QString | dataTag |
bool | failed |
bool | skipped |
int | passCount |
int | failCount |
int | skipCount |
QStringList | functionsToRun |
QStringList | tagsToRun |
![]() | |
QString | objectName |
the name of this object | |
Additional Inherited Members | |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 31 of file quicktestresult_p.h.
Enumerator | |
---|---|
RepeatUntilValidMeasurement | |
RunOnce |
Definition at line 53 of file quicktestresult_p.h.
Definition at line 168 of file quicktestresult.cpp.
References QBenchmarkGlobalData::current, and globalBenchmarkData.
|
override |
Definition at line 175 of file quicktestresult.cpp.
|
slot |
Definition at line 651 of file quicktestresult.cpp.
References QBenchmarkTestMethodData::beginDataRun(), and QBenchmarkTestMethodData::current.
|
slot |
Definition at line 409 of file quicktestresult.cpp.
References d.
|
slot |
Definition at line 558 of file quicktestresult.cpp.
References QTestResult::compare(), QByteArray::constData(), line, qtestFixUrl(), QString::toLatin1(), QVariant::toString(), and QTest::toString().
QString QuickTestResult::dataTag | ( | ) | const |
\qmlproperty string TestResult::dataTag
This property defines the tag for the current row in a data-driven test, or an empty string if not a data-driven test.
Definition at line 241 of file quicktestresult.cpp.
References QTestResult::currentDataTag(), QString::fromUtf8(), and tag.
|
signal |
|
slot |
Definition at line 656 of file quicktestresult.cpp.
References QBenchmarkGlobalData::current, QBenchmarkTestMethodData::current, d, QBenchmarkTestMethodData::endDataRun(), QList< T >::first(), QList< T >::isEmpty(), qDebug, results, and QBenchmarkTestMethodData::results.
|
static |
Definition at line 824 of file quicktestresult.cpp.
References QTestLog::failCount(), and qMin().
Referenced by quick_test_main_with_setup().
|
slot |
Definition at line 579 of file quicktestresult.cpp.
References QTest::Abort, QByteArray::constData(), QTestResult::expectFail(), line, qtestFixUrl(), tag, QString::toLatin1(), and QTest::toString().
|
slot |
Definition at line 588 of file quicktestresult.cpp.
References QByteArray::constData(), QTest::Continue, QTestResult::expectFail(), line, qtestFixUrl(), tag, QTest::toString(), and QString::toUtf8().
Definition at line 438 of file quicktestresult.cpp.
References QTestResult::addFailure(), line, and qtestFixUrl().
int QuickTestResult::failCount | ( | ) | const |
\qmlproperty int TestResult::failCount
This property returns the number of tests that have failed.
Definition at line 317 of file quicktestresult.cpp.
References QTestLog::failCount().
|
slot |
Definition at line 416 of file quicktestresult.cpp.
References QTestResult::finishedCurrentTestData().
|
slot |
Definition at line 421 of file quicktestresult.cpp.
References QTestResult::finishedCurrentTestDataCleanup().
|
slot |
Definition at line 426 of file quicktestresult.cpp.
References QTestResult::finishedCurrentTestFunction().
QString QuickTestResult::functionName | ( | ) | const |
\qmlproperty string TestResult::functionName
This property defines the name of current test function within a TestCase element that is running. If this string is empty, then no function is currently running.
Definition at line 209 of file quicktestresult.cpp.
References d.
|
signal |
QStringList QuickTestResult::functionsToRun | ( | ) | const |
\qmlproperty list<string> TestResult::functionsToRun
This property returns the list of function names to be run.
Definition at line 339 of file quicktestresult.cpp.
References QTest::testFunctions.
|
slot |
Definition at line 459 of file quicktestresult.cpp.
References QColor::alpha(), QColor::blue(), QVariant::canConvert(), QQmlColorProvider::colorFromString(), expected, QColor::green(), ok, qAbs(), QQml_colorProvider(), QColor::red(), QVariant::toFloat(), QVariant::toString(), QJSValue::toString(), QVariant::userType(), QVariant::value(), and var.
|
slot |
Definition at line 748 of file quicktestresult.cpp.
References QImage::copy(), QImage::devicePixelRatio(), QImage::height(), QRectF::intersected(), item, o, qmlContext(), QQmlEngine::setContextForObject(), QRectF::toAlignedRect(), QImage::width(), window(), QGraphicsItem::window(), QGraphicsItem::x(), and QGraphicsItem::y().
Definition at line 602 of file quicktestresult.cpp.
References QTestLog::ignoreMessage(), and QtWarningMsg.
|
slot |
Definition at line 399 of file quicktestresult.cpp.
References d.
|
slot |
Definition at line 725 of file quicktestresult.cpp.
References d.
bool QuickTestResult::isFailed | ( | ) | const |
\qmlproperty bool TestResult::failed
This property returns true if the current test function (or current test data row for a data-driven test) has failed; false otherwise. The fail state is reset when functionName is changed or finishTestDataCleanup() is called.
Definition at line 272 of file quicktestresult.cpp.
References QTestResult::currentTestFailed().
bool QuickTestResult::isSkipped | ( | ) | const |
\qmlproperty bool TestResult::skipped
This property returns true if the current test function was marked as skipped; false otherwise.
Definition at line 285 of file quicktestresult.cpp.
References QTestResult::skipCurrentTest().
|
slot |
Definition at line 675 of file quicktestresult.cpp.
References QBenchmarkTestMethodData::current, and QBenchmarkTestMethodData::resultsAccepted().
|
slot |
Definition at line 701 of file quicktestresult.cpp.
References QTestLog::addBenchmarkResults(), QBenchmarkGlobalData::adjustMedianIterationCount(), QBenchmarkGlobalData::current, QBenchmarkTestMethodData::current, d, and qMedian().
|
slot |
Definition at line 734 of file quicktestresult.cpp.
References d.
|
static |
Definition at line 798 of file quicktestresult.cpp.
References QBenchmarkGlobalData::current, globalBenchmarkData, and QTest::qtest_qParseArgs().
Referenced by quick_test_main_with_setup().
int QuickTestResult::passCount | ( | ) | const |
\qmlproperty int TestResult::passCount
This property returns the number of tests that have passed.
Definition at line 305 of file quicktestresult.cpp.
References QTestLog::passCount().
|
signal |
|
slot |
QuickTestResult::Q_REVISION | ( | 1 | , |
13 | |||
) | const |
|
slot |
QuickTestResult::Q_REVISION | ( | 6 | , |
5 | |||
) |
|
slot |
\qmlmethod TestResult::reset()
Resets all pass/fail/skip counters and prepare for testing.
Definition at line 359 of file quicktestresult.cpp.
References globalProgramName, and QTestResult::reset().
Definition at line 819 of file quicktestresult.cpp.
References QTestResult::setCurrentAppName().
Referenced by quick_test_main_with_setup().
Definition at line 250 of file quicktestresult.cpp.
References QTestPrivate::checkBlackLists(), dataTagChanged(), emit, functionName, QTest::newRow(), QTestResult::setCurrentTestData(), tag, and testCaseName.
Definition at line 215 of file quicktestresult.cpp.
References QTestPrivate::checkBlackLists(), d, emit, fullName, functionNameChanged(), and QTestResult::setCurrentTestFunction().
Definition at line 805 of file quicktestresult.cpp.
References globalProgramName, loggingStarted, QTestPrivate::parseBlackList(), QTestResult::reset(), QTestResult::setCurrentTestObject(), and QTestLog::stopLogging().
Referenced by quick_test_main_with_setup().
void QuickTestResult::setSkipped | ( | bool | skip | ) |
Definition at line 290 of file quicktestresult.cpp.
References emit, QTestResult::setBlacklistCurrentTest(), QTestResult::setSkipCurrentTest(), skip(), and skippedChanged().
Definition at line 193 of file quicktestresult.cpp.
References d, emit, and testCaseNameChanged().
Definition at line 571 of file quicktestresult.cpp.
References QTestResult::addSkip(), line, qtestFixUrl(), and QTestResult::setSkipCurrentTest().
Referenced by setSkipped().
int QuickTestResult::skipCount | ( | ) | const |
\qmlproperty int TestResult::skipCount
This property returns the number of tests that have been skipped.
Definition at line 329 of file quicktestresult.cpp.
References QTestLog::skipCount().
|
signal |
|
slot |
Definition at line 629 of file quicktestresult.cpp.
References QTest::qSleep().
Definition at line 712 of file quicktestresult.cpp.
References QBenchmarkGlobalData::context, QBenchmarkGlobalData::current, QBenchmarkTestMethodData::current, d, functionName, QBenchmarkTestMethodData::resultAccepted, QBenchmarkTestMethodData::results, QBenchmarkContext::slotName, QBenchmarkContext::tag, and tag.
|
slot |
\qmlmethod TestResult::startLogging()
Starts logging to the test output stream and writes the test header.
Definition at line 373 of file quicktestresult.cpp.
References loggingStarted, and QTestLog::startLogging().
|
slot |
Definition at line 641 of file quicktestresult.cpp.
References QBenchmarkGlobalData::current, QBenchmarkTestMethodData::current, d, QBenchmarkGlobalData::measurer, and QBenchmarkMeasurerBase::needsWarmupIteration().
|
slot |
Definition at line 741 of file quicktestresult.cpp.
References d.
|
slot |
\qmlmethod TestResult::stopLogging()
Writes the test footer to the test output stream and then stops logging.
Definition at line 390 of file quicktestresult.cpp.
References d, globalProgramName, QTestResult::setCurrentTestObject(), and QTestLog::stopLogging().
|
slot |
Definition at line 503 of file quicktestresult.cpp.
References QString::arg(), args, QV4::Value::as(), QString::fromLatin1(), Qt::ISODateWithMs, QList< T >::length(), QV4::Encode::null(), QUrl::toString(), QV4::ExecutionEngine::toVariant(), url, QVector3D::x(), QVector3D::y(), and QVector3D::z().
QStringList QuickTestResult::tagsToRun | ( | ) | const |
\qmlproperty list<string> TestResult::tagsToRun
This property returns the list of test function's data tags to be run
Definition at line 349 of file quicktestresult.cpp.
References QTest::testTags.
QString QuickTestResult::testCaseName | ( | ) | const |
\qmlproperty string TestResult::testCaseName
This property defines the name of current TestCase element that is running test cases.
Definition at line 187 of file quicktestresult.cpp.
References d.
|
signal |
|
slot |
Definition at line 445 of file quicktestresult.cpp.
References line, qtestFixUrl(), and QTestResult::verify().
|
slot |
Definition at line 624 of file quicktestresult.cpp.
References QTest::qWait().
|
slot |
Definition at line 634 of file quicktestresult.cpp.
References item, Q_ASSERT, qWaitForSignal(), SIGNAL, and QGraphicsItem::window().
Definition at line 597 of file quicktestresult.cpp.
References line, qtestFixUrl(), and QTestLog::warn().
int timeout QuickTestResult::const |
Definition at line 133 of file quicktestresult_p.h.
Definition at line 130 of file quicktestresult_p.h.
|
readwrite |
Definition at line 156 of file quicktestresult_p.h.
|
read |
Definition at line 156 of file quicktestresult_p.h.
|
read |
Definition at line 156 of file quicktestresult_p.h.
|
readwrite |
Definition at line 156 of file quicktestresult_p.h.
Referenced by setDataTag(), and startBenchmark().
|
read |
Definition at line 156 of file quicktestresult_p.h.
|
read |
Definition at line 156 of file quicktestresult_p.h.
|
read |
Definition at line 156 of file quicktestresult_p.h.
|
readwrite |
Definition at line 156 of file quicktestresult_p.h.
|
read |
Definition at line 156 of file quicktestresult_p.h.
|
readwrite |
Definition at line 156 of file quicktestresult_p.h.
Referenced by setDataTag().