Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
[15] More...
Namespaces | |
namespace | CrashHandler |
namespace | Internal |
Classes | |
struct | IgnoreResultList |
class | QBenchmarkIterationController |
struct | QBenchmarkMetricKey |
struct | QTestDataSetter |
class | QTouchEventSequence |
class | QTouchEventWidgetSequence |
class | TestMethods |
class | TestRegistry |
class | ThrowOnFailDisabler |
class | ThrowOnFailEnabler |
class | ThrowOnSkipDisabler |
class | ThrowOnSkipEnabler |
class | WatchDog |
Functions | |
Q_CORE_EXPORT void | qSleep (int ms) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sleeps for ms milliseconds, blocking execution of the test. | |
Q_CORE_EXPORT void | qSleep (std::chrono::milliseconds msecs) |
template<typename Functor > | |
bool | qWaitFor (Functor predicate, QDeadlineTimer deadline=QDeadlineTimer(std::chrono::seconds{5})) |
template<typename Functor > | |
bool | qWaitFor (Functor predicate, int timeout) |
Q_CORE_EXPORT void | qWait (int ms) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Waits for msecs. | |
Q_CORE_EXPORT void | qWait (std::chrono::milliseconds msecs) |
Q_GUI_EXPORT bool | qWaitForWindowActive (QWindow *window, int timeout=5000) |
Q_GUI_EXPORT bool | qWaitForWindowFocused (QWindow *widget, QDeadlineTimer timeout=std::chrono::seconds{5}) |
Q_GUI_EXPORT bool | qWaitForWindowExposed (QWindow *window, int timeout=5000) |
Q_GUI_EXPORT QPointingDevice * | createTouchDevice (QInputDevice::DeviceType devType=QInputDevice::DeviceType::TouchScreen, QInputDevice::Capabilities caps=QInputDevice::Capability::Position) |
template<> | |
char * | toString (const MyPoint &point) |
int | qt_asprintf (QTestCharBuffer *str, const char *format,...) |
void Q_TESTLIB_EXPORT | setBenchmarkResult (qreal result, QBenchmarkMetric metric) |
Sets the benchmark result for this test function to result. | |
int | iterationCount () noexcept |
void | setIterationCountHint (int count) |
void | setIterationCount (int count) |
void | beginBenchmarkMeasurement () |
QList< QBenchmarkMeasurerBase::Measurement > | endBenchmarkMeasurement () |
const char * | benchmarkMetricName (QBenchmarkMetric metric) |
const char * | benchmarkMetricUnit (QBenchmarkMetric metric) |
static const char * | ptIncidentType2String (QAbstractTestLogger::IncidentTypes type) |
static const char * | benchmarkResult2String () |
static const char * | ptMessageType2String (QAbstractTestLogger::MessageTypes type) |
template<typename T > | |
static int | countSignificantDigits (T num) |
template<typename T > | |
QByteArray | formatResult (T number, int significantDigits) |
static void | qPrintMessage (const QByteArray &ba) |
static bool | classIsIgnored (const char *className) |
static void | qSignalDumperCallback (QObject *caller, int signal_index, void **argv) |
static void | qSignalDumperCallbackSlot (QObject *caller, int method_index, void **argv) |
static void | qSignalDumperCallbackEndSignal (QObject *caller, int) |
static const char * | tcIncidentType2String (QAbstractTestLogger::IncidentTypes type) |
static const char * | tcMessageType2String (QAbstractTestLogger::MessageTypes type) |
template<> | |
bool | qCompare (QString const &t1, QLatin1StringView const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (QLatin1StringView const &t1, QString const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename ActualIterator , typename ExpectedIterator > | |
bool | _q_compareSequence (ActualIterator actualIt, ActualIterator actualEnd, ExpectedIterator expectedBegin, ExpectedIterator expectedEnd, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (QList< T > const &t1, QList< T > const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T , int N> | |
bool | qCompare (QList< T > const &t1, std::initializer_list< T > t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T , int N> | |
bool | qCompare (QList< T > const &t1, const T(&t2)[N], const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (QFlags< T > const &t1, T const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (QFlags< T > const &t1, int const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (qint64 const &t1, qint32 const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (qint64 const &t1, quint32 const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (quint64 const &t1, quint32 const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (qint32 const &t1, qint64 const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (quint32 const &t1, qint64 const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (quint32 const &t1, quint64 const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
char * | toString (const QColor &color) |
template<> | |
char * | toString (const QRegion ®ion) |
template<> | |
char * | toString (const QVector2D &v) |
template<> | |
char * | toString (const QVector3D &v) |
template<> | |
char * | toString (const QVector4D &v) |
bool | qCompare (QIcon const &t1, QIcon const &t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (QImage const &t1, QImage const &t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (QPixmap const &t1, QPixmap const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
char * | toString< QHostAddress > (const QHostAddress &addr) |
void | setThrowOnFail (bool enable) noexcept |
void | setThrowOnSkip (bool enable) noexcept |
static bool | invokeTestMethodIfValid (QMetaMethod m, QObject *obj=QTest::currentTestObject) |
static void | invokeTestMethodIfExists (const char *methodName, QObject *obj=QTest::currentTestObject) |
int | defaultEventDelay () |
int Q_TESTLIB_EXPORT | defaultMouseDelay () |
int Q_TESTLIB_EXPORT | defaultKeyDelay () |
static bool | qPrintTestSlots (FILE *stream, const char *filter=nullptr, const char *preamble="") |
static void | qPrintDataTags (FILE *stream) |
static int | qToInt (const char *str) |
Q_TESTLIB_EXPORT void | qtest_qParseArgs (int argc, const char *const argv[], bool qml) |
Q_TESTLIB_EXPORT void | qtest_qParseArgs (int argc, char *argv[], bool qml) |
static QList< QBenchmarkResult > | qMedian (const QList< QList< QBenchmarkResult > > &container) |
static void | printUnknownDataTagError (QLatin1StringView name, QLatin1StringView tag, const QTestTable &lTable, const QTestTable &gTable) |
void * | fetchData (QTestData *data, const char *tagName, int typeId) |
char * | formatString (const char *prefix, const char *suffix, size_t numArguments,...) |
char * | toHexRepresentation (const char *ba, qsizetype length) |
Returns a pointer to a string that is the string ba represented as a space-separated sequence of hex characters. | |
char * | toPrettyCString (const char *p, qsizetype length) |
switch (ch) | |
return | first (2) |
Q_TESTLIB_EXPORT void | qInit (QObject *testObject, int argc=0, char **argv=nullptr) |
Q_TESTLIB_EXPORT int | qRun () |
Q_TESTLIB_EXPORT void | qCleanup () |
Q_TESTLIB_EXPORT int | qExec (QObject *testObject, int argc=0, char **argv=nullptr) |
Executes tests declared in testObject. | |
Q_TESTLIB_EXPORT int | qExec (QObject *testObject, const QStringList &arguments) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Q_TESTLIB_EXPORT void | setMainSourcePath (const char *file, const char *builddir=nullptr) |
Q_TESTLIB_EXPORT bool | qVerify (bool statement, const char *statementStr, const char *description, const char *file, int line) |
Q_DECL_COLD_FUNCTION Q_TESTLIB_EXPORT void | qFail (const char *message, const char *file, int line) |
Q_TESTLIB_EXPORT void | qSkip (const char *message, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qExpectFail (const char *dataIndex, const char *comment, TestFailMode mode, const char *file, int line) |
Q_DECL_COLD_FUNCTION Q_TESTLIB_EXPORT void | qCaught (const char *expected, const char *what, const char *file, int line) |
Q_DECL_COLD_FUNCTION Q_TESTLIB_EXPORT void | qCaught (const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT void | ignoreMessage (QtMsgType type, const char *message) |
Ignores messages created by qDebug(), qInfo() or qWarning(). | |
Q_TESTLIB_EXPORT void | failOnWarning () |
Q_TESTLIB_EXPORT void | failOnWarning (const char *message) |
Q_TESTLIB_EXPORT QString | qFindTestData (const char *basepath, const char *file=nullptr, int line=0, const char *builddir=nullptr, const char *sourcedir=nullptr) |
Q_TESTLIB_EXPORT QString | qFindTestData (const QString &basepath, const char *file=nullptr, int line=0, const char *builddir=nullptr, const char *sourcedir=nullptr) |
Q_TESTLIB_EXPORT void * | qData (const char *tagName, int typeId) |
Q_TESTLIB_EXPORT void * | qGlobalData (const char *tagName, int typeId) |
Q_TESTLIB_EXPORT void * | qElementData (const char *elementName, int metaTypeId) |
Q_TESTLIB_EXPORT QObject * | testObject () |
Q_TESTLIB_EXPORT const char * | currentAppName () |
Returns the name of the binary that is currently executed. | |
Q_TESTLIB_EXPORT const char * | currentTestFunction () |
Returns the name of the test function that is currently executed. | |
Q_TESTLIB_EXPORT const char * | currentDataTag () |
Returns the name of the current test data. | |
Q_TESTLIB_EXPORT bool | currentTestFailed () |
Returns true if the current test function has failed, otherwise false. | |
Q_TESTLIB_EXPORT bool | currentTestResolved () |
Q_TESTLIB_EXPORT bool | runningTest () |
Q_TESTLIB_EXPORT Qt::Key | asciiToKey (char ascii) |
Q_TESTLIB_EXPORT char | keyToAscii (Qt::Key key) |
Q_TESTLIB_EXPORT bool | compare_helper (bool success, const char *failureMsg, const void *actualPtr, const void *expectedPtr, const char *(*actualFormatter)(const void *), const char *(*expectedFormatter)(const void *), const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | compare_helper (bool success, const char *failureMsg, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT void | addColumnInternal (int id, const char *name) |
template<typename T > | |
void | addColumn (const char *name, T *=nullptr) |
Adds a column with type {T} to the current test data. | |
Q_TESTLIB_EXPORT QTestData & | newRow (const char *dataTag) |
Appends a new row to the current test data. | |
Q_TESTLIB_EXPORT QTestData & | addRow (const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1 |
Q_TESTLIB_EXPORT QTestData Q_TESTLIB_EXPORT bool | qCompare (qfloat16 const &t1, qfloat16 const &t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qCompare (float const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qCompare (double const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qCompare (int t1, int t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qCompare (unsigned t1, unsigned t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qCompare (QStringView t1, QStringView t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qCompare (QStringView t1, const QLatin1StringView &t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | qCompare (const QLatin1StringView &t1, QStringView t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (const QString &t1, const QString &t2, const char *actual, const char *expected, const char *file, int line) |
bool | compare_ptr_helper (const volatile void *t1, const volatile void *t2, const char *actual, const char *expected, const char *file, int line) |
bool | compare_ptr_helper (const volatile QObject *t1, const volatile QObject *t2, const char *actual, const char *expected, const char *file, int line) |
bool | compare_ptr_helper (const volatile QObject *t1, std::nullptr_t, const char *actual, const char *expected, const char *file, int line) |
bool | compare_ptr_helper (std::nullptr_t, const volatile QObject *t2, const char *actual, const char *expected, const char *file, int line) |
bool | compare_ptr_helper (const volatile void *t1, std::nullptr_t, const char *actual, const char *expected, const char *file, int line) |
bool | compare_ptr_helper (std::nullptr_t, const volatile void *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T1 , typename T2 = T1> | |
bool | qCompare (const T1 &t1, const T2 &t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (double const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (float const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (const T *t1, const T *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (T *t1, T *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (T *t1, std::nullptr_t, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (std::nullptr_t, T *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T1 , typename T2 > | |
bool | qCompare (const T1 *t1, const T2 *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T1 , typename T2 > | |
bool | qCompare (T1 *t1, T2 *t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (const char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (char *t1, char *t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) |
bool | qCompare (const char *t1, char *t2, const char *actual, const char *expected, const char *file, int line) |
template<class T > | |
bool | qTest (const T &actual, const char *elementName, const char *actualStr, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | reportResult (bool success, const void *lhs, const void *rhs, const char *(*lhsFormatter)(const void *), const char *(*rhsFormatter)(const void *), const char *lhsExpr, const char *rhsExpr, ComparisonOperation op, const char *file, int line) |
template<ComparisonOperation op, typename T1 , typename T2 = T1> | |
bool | qCompareOp (T1 &&lhs, T2 &&rhs, const char *lhsExpr, const char *rhsExpr, const char *file, int line) |
static void | simulateEvent (QWindow *window, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1) |
static void | sendKeyEvent (KeyAction action, QWindow *window, Qt::Key code, QString text, Qt::KeyboardModifiers modifier, int delay=-1) |
static void | sendKeyEvent (KeyAction action, QWindow *window, Qt::Key code, char ascii, Qt::KeyboardModifiers modifier, int delay=-1) |
static void | keyEvent (KeyAction action, QWindow *window, char ascii, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyEvent (KeyAction action, QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyClick (QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyClick (QWindow *window, char key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyRelease (QWindow *window, char key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyRelease (QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyPress (QWindow *window, char key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyPress (QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static bool | handleIgnoredMessage (QtMsgType type, const QString &message) |
static bool | handleFailOnWarning (const QMessageLogContext &context, const QString &message) |
static void | messageHandler (QtMsgType type, const QMessageLogContext &context, const QString &message) |
static void | mouseEvent (MouseAction action, QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1) |
void | mousePress (QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=Qt::KeyboardModifiers(), QPoint pos=QPoint(), int delay=-1) |
void | mouseRelease (QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=Qt::KeyboardModifiers(), QPoint pos=QPoint(), int delay=-1) |
void | mouseClick (QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=Qt::KeyboardModifiers(), QPoint pos=QPoint(), int delay=-1) |
void | mouseDClick (QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=Qt::KeyboardModifiers(), QPoint pos=QPoint(), int delay=-1) |
void | mouseMove (QWindow *window, QPoint pos=QPoint(), int delay=-1) |
Q_GLOBAL_STATIC (TestRegistry, g_registry) | |
static void | setFailed (bool failed) |
static void | resetFailed () |
static bool | hasFailed () |
Q_TESTLIB_EXPORT bool | compare_string_helper (const char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT char * | toPrettyUnicode (QStringView string) |
Q_TESTLIB_EXPORT char * | toString (const char *) |
Q_TESTLIB_EXPORT char * | toString (const volatile void *) |
Q_TESTLIB_EXPORT char * | toString (const volatile QObject *) |
template<typename T , Internal::is_suitable_type_v< T > = true> | |
char * | toString (const T &t) |
template<typename T1 , typename T2 > | |
char * | toString (const std::pair< T1, T2 > &pair) |
template<class... Types> | |
char * | toString (const std::tuple< Types... > &tuple) |
template<typename Rep , typename Period > | |
char * | toString (std::chrono::duration< Rep, Period > duration) |
template<> | |
char * | toString (const QStringView &str) |
template<> | |
char * | toString (const QString &str) |
template<> | |
char * | toString (const QLatin1StringView &str) |
template<> | |
char * | toString (const QByteArray &ba) |
template<> | |
char * | toString (const QBitArray &ba) |
template<> | |
char * | toString (const QCborError &c) |
template<> | |
char * | toString (const QChar &c) |
template<> | |
char * | toString (const QPoint &p) |
template<> | |
char * | toString (const QSize &s) |
template<> | |
char * | toString (const QRect &s) |
template<> | |
char * | toString (const QPointF &p) |
template<> | |
char * | toString (const QSizeF &s) |
template<> | |
char * | toString (const QRectF &s) |
template<> | |
char * | toString (const QUrl &uri) |
template<> | |
char * | toString (const QUuid &uuid) |
template<> | |
char * | toString (const QVariant &v) |
template<> | |
char * | toString (const QPartialOrdering &o) |
template<> | |
char * | toString (const QCborValue &v) |
template<> | |
char * | toString (const QCborValueRef &v) |
template<> | |
char * | toString (const QCborArray &a) |
template<> | |
char * | toString (const QCborMap &m) |
template<typename Tuple , std::size_t... I> | |
char * | tupleToString (const Tuple &tuple, std::index_sequence< I... >) |
char * | toString (std::nullptr_t) |
QTouchEventSequence | touchEvent (QWindow *window, QPointingDevice *device, bool autoCommit=true) |
static void | wheelEvent (QWindow *window, QPointF pos, QPoint angleDelta, QPoint pixelDelta=QPoint(0, 0), Qt::KeyboardModifiers stateKey=Qt::NoModifier, Qt::ScrollPhase phase=Qt::NoScrollPhase) |
static const char * | xmlMessageType2String (QAbstractTestLogger::MessageTypes type) |
static const char * | xmlIncidentType2String (QAbstractTestLogger::IncidentTypes type) |
static bool | isEmpty (const char *str) |
static const char * | incidentFormatString (bool noDescription, bool noTag) |
static const char * | benchmarkResultFormatString () |
static const char * | messageFormatString (bool noDescription, bool noTag) |
Q_WIDGETS_EXPORT bool | qWaitForWindowActive (QWidget *widget, int timeout=5000) |
Q_WIDGETS_EXPORT bool | qWaitForWindowFocused (QWidget *widget, QDeadlineTimer timeout=std::chrono::seconds{5}) |
Q_WIDGETS_EXPORT bool | qWaitForWindowExposed (QWidget *widget, int timeout=5000) |
char * | toString (const QGeoAreaMonitorInfo &info) |
char * | toString (const QGeoPositionInfo &info) |
char * | toString (const QGeoSatelliteInfo &info) |
[15]
[16]
anonymous enum |
Enumerator | |
---|---|
IndentSpacesCount |
Definition at line 30 of file qsignaldumper.cpp.
anonymous enum |
Enumerator | |
---|---|
Unresolved | |
Passed | |
Skipped | |
Suppressed | |
Failed |
Definition at line 81 of file qtestlog.cpp.
Enumerator | |
---|---|
AI_Undefined | |
AI_Name | |
AI_Tests | |
AI_Failures | |
AI_Errors | |
AI_Type | |
AI_Message | |
AI_PropertyValue | |
AI_Value | |
AI_Time | |
AI_Timestamp | |
AI_Hostname | |
AI_Classname | |
AI_Skipped |
Definition at line 26 of file qtestelementattribute_p.h.
|
strong |
Enumerator | |
---|---|
CustomCompare | |
Equal | |
NotEqual | |
LessThan | |
LessThanOrEqual | |
GreaterThan | |
GreaterThanOrEqual |
Definition at line 26 of file qttestglobal.h.
enum QTest::KeyAction |
Enumerator | |
---|---|
Press | |
Release | |
Click | |
Shortcut |
Definition at line 37 of file qtestkeyboard.h.
Enumerator | |
---|---|
LET_Undefined | |
LET_Property | |
LET_Properties | |
LET_Failure | |
LET_Error | |
LET_TestCase | |
LET_TestSuite | |
LET_Text | |
LET_SystemError | |
LET_SystemOutput | |
LET_Skipped |
Definition at line 44 of file qtestelementattribute_p.h.
enum QTest::MouseAction |
Enumerator | |
---|---|
MousePress | |
MouseRelease | |
MouseClick | |
MouseDClick | |
MouseMove |
Definition at line 42 of file qtestmouse.h.
This enum lists all the things that can be benchmarked.
\value FramesPerSecond Frames per second \value BitsPerSecond Bits per second \value BytesPerSecond Bytes per second \value WalltimeMilliseconds Clock time in milliseconds \value WalltimeNanoseconds Clock time in nanoseconds \value BytesAllocated Memory usage in bytes \value Events Event count \value CPUTicks CPU time \value CPUMigrations Process migrations between CPUs \value CPUCycles CPU cycles \value RefCPUCycles Reference CPU cycles \value BusCycles Bus cycles \value StalledCycles Cycles stalled \value InstructionReads Instruction reads \value Instructions Instructions executed \value BranchInstructions Branch-type instructions \value BranchMisses Branch instructions that were mispredicted \value CacheReferences Cache accesses of any type \value CacheMisses Cache misses of any type \value CacheReads Cache reads / loads \value CacheReadMisses Cache read / load misses \value CacheWrites Cache writes / stores \value CacheWriteMisses Cache write / store misses \value CachePrefetches Cache prefetches \value CachePrefetchMisses Cache prefetch misses \value ContextSwitches Context switches \value PageFaults Page faults of any type \value MinorPageFaults Minor page faults \value MajorPageFaults Major page faults \value AlignmentFaults Faults caused due to misalignment \value EmulationFaults Faults that needed software emulation
Note that WalltimeNanoseconds
and BytesAllocated
are only provided for use via \l setBenchmarkResult(), and results in those metrics are not able to be provided automatically by the QTest framework.
Definition at line 15 of file qbenchmarkmetric.h.
enum QTest::TestFailMode |
Enumerator | |
---|---|
Abort | |
Continue |
Definition at line 25 of file qttestglobal.h.
bool QTest::_q_compareSequence | ( | ActualIterator | actualIt, |
ActualIterator | actualEnd, | ||
ExpectedIterator | expectedBegin, | ||
ExpectedIterator | expectedEnd, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 45 of file qtest.h.
References compare_helper(), expected, file, i, line, qsnprintf(), and toString().
Referenced by qCompare(), qCompare(), and qCompare().
|
inline |
Adds a column with type {T} to the current test data.
name is the name of the column. dummy is a workaround for buggy compilers and can be ignored.
To populate the column with values, newRow() can be used. Use \l QFETCH() to fetch the data in the actual test.
Example:
To add custom types to the testdata, the type must be registered with QMetaType via \l Q_DECLARE_METATYPE().
See \l {Chapter 2: Data Driven Testing}{Data Driven Testing} for a more extensive example.
Definition at line 498 of file qtestcase.h.
References addColumnInternal().
void QTest::addColumnInternal | ( | int | id, |
const char * | name ) |
Definition at line 2545 of file qtestcase.cpp.
References QTestTable::currentTestTable(), and QTEST_ASSERT_X.
Referenced by addColumn().
QTestData & QTest::addRow | ( | const char * | format, |
... ) |
Appends a new row to the current test data.
The function's arguments are passed to qsnprintf() for formatting according to format. See the qvsnprintf() documentation for caveats and limitations.
The test output will identify the test run with this test data using the name that results from this formatting.
Returns a QTestData reference that can be used to stream in data, one value for each column in the table.
Example:
See \l {Chapter 2: Data Driven Testing}{Data Driven Testing} for a more extensive example.
Definition at line 2610 of file qtestcase.cpp.
References QTestTable::currentTestTable(), QTEST_ASSERT_X, qvsnprintf(), and void.
Referenced by MyTestClass::addMultStringRows(), and for().
QT_BEGIN_NAMESPACE Qt::Key QTest::asciiToKey | ( | char | ascii | ) |
Convert an ascii char key value to a Qt Key value. If the key is unknown a 0 is returned.
Note: this may happen more than you like since not all known ascii keys are converted already. So feel free to add all the keys you need.
Definition at line 16 of file qasciikey.cpp.
References Qt::Key_0, Qt::Key_1, Qt::Key_2, Qt::Key_3, Qt::Key_4, Qt::Key_5, Qt::Key_6, Qt::Key_7, Qt::Key_8, Qt::Key_9, Qt::Key_A, Qt::Key_Aacute, Qt::Key_Acircumflex, Qt::Key_acute, Qt::Key_Adiaeresis, Qt::Key_AE, Qt::Key_Agrave, Qt::Key_Ampersand, Qt::Key_Apostrophe, Qt::Key_Aring, Qt::Key_AsciiCircum, Qt::Key_AsciiTilde, Qt::Key_Asterisk, Qt::Key_At, Qt::Key_Atilde, Qt::Key_B, Qt::Key_Backslash, Qt::Key_Backspace, Qt::Key_Backtab, Qt::Key_Bar, Qt::Key_BraceLeft, Qt::Key_BraceRight, Qt::Key_BracketLeft, Qt::Key_BracketRight, Qt::Key_brokenbar, Qt::Key_C, Qt::Key_Ccedilla, Qt::Key_cedilla, Qt::Key_cent, Qt::Key_Colon, Qt::Key_Comma, Qt::Key_copyright, Qt::Key_currency, Qt::Key_D, Qt::Key_degree, Qt::Key_diaeresis, Qt::Key_division, Qt::Key_Dollar, Qt::Key_Down, Qt::Key_E, Qt::Key_Eacute, Qt::Key_Ecircumflex, Qt::Key_Ediaeresis, Qt::Key_Egrave, Qt::Key_Equal, Qt::Key_Escape, Qt::Key_ETH, Qt::Key_Exclam, Qt::Key_exclamdown, Qt::Key_F, Qt::Key_G, Qt::Key_Greater, Qt::Key_guillemotleft, Qt::Key_guillemotright, Qt::Key_H, Qt::Key_hyphen, Qt::Key_I, Qt::Key_Iacute, Qt::Key_Icircumflex, Qt::Key_Idiaeresis, Qt::Key_Igrave, Qt::Key_J, Qt::Key_K, Qt::Key_L, Qt::Key_Less, Qt::Key_M, Qt::Key_macron, Qt::Key_masculine, Qt::Key_micro, Qt::Key_Minus, Qt::Key_multiply, Qt::Key_N, Qt::Key_nobreakspace, Qt::Key_notsign, Qt::Key_Ntilde, Qt::Key_NumberSign, Qt::Key_O, Qt::Key_Oacute, Qt::Key_Ocircumflex, Qt::Key_Odiaeresis, Qt::Key_Ograve, Qt::Key_onehalf, Qt::Key_onequarter, Qt::Key_onesuperior, Qt::Key_Ooblique, Qt::Key_ordfeminine, Qt::Key_Otilde, Qt::Key_P, Qt::Key_paragraph, Qt::Key_ParenLeft, Qt::Key_ParenRight, Qt::Key_Percent, Qt::Key_Period, Qt::Key_periodcentered, Qt::Key_Plus, Qt::Key_plusminus, Qt::Key_Q, Qt::Key_Question, Qt::Key_questiondown, Qt::Key_QuoteDbl, Qt::Key_QuoteLeft, Qt::Key_R, Qt::Key_registered, Qt::Key_Return, Qt::Key_S, Qt::Key_section, Qt::Key_Semicolon, Qt::Key_Slash, Qt::Key_Space, Qt::Key_ssharp, Qt::Key_sterling, Qt::Key_T, Qt::Key_Tab, Qt::Key_THORN, Qt::Key_threequarters, Qt::Key_threesuperior, Qt::Key_twosuperior, Qt::Key_U, Qt::Key_Uacute, Qt::Key_Ucircumflex, Qt::Key_Udiaeresis, Qt::Key_Ugrave, Qt::Key_Underscore, Qt::Key_Up, Qt::Key_V, Qt::Key_W, Qt::Key_X, Qt::Key_Y, Qt::Key_Yacute, Qt::Key_ydiaeresis, Qt::Key_yen, Qt::Key_Z, and QTEST_ASSERT.
Referenced by keyEvent().
void QTest::beginBenchmarkMeasurement | ( | ) |
Definition at line 208 of file qbenchmark.cpp.
References QBenchmarkGlobalData::current.
Referenced by QTest::QBenchmarkIterationController::QBenchmarkIterationController(), and QTest::QBenchmarkIterationController::QBenchmarkIterationController().
const char * QTest::benchmarkMetricName | ( | QBenchmarkMetric | metric | ) |
Definition at line 104 of file qbenchmarkmetric.cpp.
References entries, and NumEntries.
Referenced by QCsvBenchmarkLogger::addBenchmarkResult().
const char * QTest::benchmarkMetricUnit | ( | QBenchmarkMetric | metric | ) |
Definition at line 116 of file qbenchmarkmetric.cpp.
References entries, and NumEntries.
|
static |
Definition at line 131 of file qplaintestlogger.cpp.
|
static |
Definition at line 192 of file qxmltestlogger.cpp.
Referenced by QXmlTestLogger::addBenchmarkResult().
|
static |
Definition at line 32 of file qsignaldumper.cpp.
References className, ignoreClassesMutex, isEmpty(), and Q_LIKELY.
Referenced by qSignalDumperCallback(), qSignalDumperCallbackEndSignal(), and qSignalDumperCallbackSlot().
bool QTest::compare_helper | ( | bool | success, |
const char * | failureMsg, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
This overload should be used when there is no string representation of actual and expected values, so only the failureMsg is shown when the comparison fails. Because of that, failureMsg can't be {nullptr}
. If the comparison succeeds, failureMsg will not be output.
Definition at line 2836 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, and line.
bool QTest::compare_helper | ( | bool | success, |
const char * | failureMsg, | ||
const void * | actualPtr, | ||
const void * | expectedPtr, | ||
const char *(*)(const void *) | actualFormatter, | ||
const char *(*)(const void *) | expectedFormatter, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
The failureMsg parameter can be {nullptr}
, in which case a default message will be output if the compare fails. If the comparison succeeds, failureMsg will not be output.
Definition at line 2812 of file qtestcase.cpp.
References CustomCompare, expected, file, line, and QTestResult::reportResult().
Referenced by _q_compareSequence(), compare_ptr_helper(), compare_ptr_helper(), compare_ptr_helper(), compare_ptr_helper(), compare_ptr_helper(), compare_ptr_helper(), compare_string_helper(), qCompare(), qCompare(), qCompare(), and qCompare().
|
inline |
Definition at line 564 of file qtestcase.h.
References compare_helper(), expected, file, line, and t2.
|
inline |
Definition at line 573 of file qtestcase.h.
References compare_helper(), expected, file, and line.
|
inline |
Definition at line 555 of file qtestcase.h.
References compare_helper(), expected, file, line, and t2.
Referenced by qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), and qCompare().
|
inline |
Definition at line 593 of file qtestcase.h.
References compare_helper(), expected, file, and line.
|
inline |
Definition at line 583 of file qtestcase.h.
References compare_helper(), expected, file, line, and t2.
|
inline |
Definition at line 603 of file qtestcase.h.
References compare_helper(), expected, file, line, and t2.
bool QTest::compare_string_helper | ( | const char * | t1, |
const char * | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 3184 of file qtestcase.cpp.
References compare_helper(), expected, file, line, qstrcmp(), and t2.
Referenced by qCompare(), qCompare(), qCompare(), and qCompare().
|
static |
Definition at line 158 of file qplaintestlogger.cpp.
References digits().
Q_GUI_EXPORT QPointingDevice * QTest::createTouchDevice | ( | QInputDevice::DeviceType | devType = QInputDevice::DeviceType::TouchScreen, |
QInputDevice::Capabilities | caps = QInputDevice::Capability::Position ) |
Definition at line 1222 of file qwindowsysteminterface.cpp.
References createTouchDevice(), QPointingDevice::Finger, nextId, QWindowSystemInterface::registerInputDevice(), and ret.
Referenced by createTouchDevice(), and processTouchEvent().
const char * QTest::currentAppName | ( | ) |
Returns the name of the binary that is currently executed.
Definition at line 2658 of file qtestcase.cpp.
References QTestResult::currentAppName().
const char * QTest::currentDataTag | ( | ) |
Returns the name of the current test data.
If the test doesn't have any assigned testdata, the function returns \nullptr.
Definition at line 2679 of file qtestcase.cpp.
References QTestResult::currentDataTag().
bool QTest::currentTestFailed | ( | ) |
Returns true
if the current test function has failed, otherwise false.
Definition at line 2689 of file qtestcase.cpp.
References QTestResult::currentTestFailed().
Referenced by QTestPrivate::testAllComparisonOperatorsCompile().
const char * QTest::currentTestFunction | ( | ) |
Returns the name of the test function that is currently executed.
Example:
Definition at line 2670 of file qtestcase.cpp.
References QTestResult::currentTestFunction().
Referenced by MyTestClass::cleanup(), and QTest::CrashHandler::printTestRunTime().
bool QTest::currentTestResolved | ( | ) |
true
if the current test function has failed or skipped.This applies if the test has failed or exercised a skip. When it is true, the test function should return early. In particular, the {QTRY_*} macros and the test event loop terminate their loops early if executed during the test function (but not its cleanup()). After a test has called a helper function that uses this module's macros, it can use this function to test whether to return early.
Definition at line 2707 of file qtestcase.cpp.
References QTestResult::currentTestFailed(), and QTestResult::skipCurrentTest().
Referenced by QTestEventLoop::enterLoop().
int QTest::defaultEventDelay | ( | ) |
Definition at line 463 of file qtestcase.cpp.
References QByteArray::constData(), eventDelay, QByteArray::isEmpty(), and qgetenv().
Referenced by defaultKeyDelay(), and defaultMouseDelay().
int Q_TESTLIB_EXPORT QTest::defaultKeyDelay | ( | ) |
Definition at line 487 of file qtestcase.cpp.
References QByteArray::constData(), defaultEventDelay(), QByteArray::isEmpty(), keyDelay, and qgetenv().
int Q_TESTLIB_EXPORT QTest::defaultMouseDelay | ( | ) |
Definition at line 475 of file qtestcase.cpp.
References QByteArray::constData(), defaultEventDelay(), QByteArray::isEmpty(), mouseDelay, and qgetenv().
Referenced by QuickTestEvent::defaultMouseDelay(), QtQuickTest::mouseEvent(), mouseEvent(), QQuickTest::pointerMove(), QQuickTest::pointerPress(), and QQuickTest::pointerRelease().
QList< QBenchmarkMeasurerBase::Measurement > QTest::endBenchmarkMeasurement | ( | ) |
Definition at line 216 of file qbenchmark.cpp.
References QBenchmarkGlobalData::current.
Referenced by QTest::QBenchmarkIterationController::~QBenchmarkIterationController().
|
related |
Definition at line 2212 of file qtestcase.cpp.
References QTestLog::failOnWarning().
Referenced by QQmlDataTest::init().
void QTest::failOnWarning | ( | const char * | message | ) |
Definition at line 2225 of file qtestcase.cpp.
References QTestLog::failOnWarning().
Definition at line 1414 of file qtestcase.cpp.
References QMetaType::name(), Q_UNLIKELY, qFatal, QTEST_ASSERT, and QTEST_ASSERT_X.
Referenced by qData(), and qGlobalData().
return QTest::first | ( | 2 | ) |
QByteArray QTest::formatResult | ( | T | number, |
int | significantDigits ) |
Definition at line 175 of file qplaintestlogger.cpp.
References QByteArray::append(), i, number, QByteArray::number(), and qMin().
Q_TESTLIB_EXPORT char * QTest::formatString | ( | const char * | prefix, |
const char * | suffix, | ||
size_t | numArguments, | ||
... ) |
Definition at line 1439 of file qtestcase.cpp.
References arguments, QList< T >::constData(), i, and qstrdup().
Referenced by toString(), and tupleToString().
|
static |
Definition at line 180 of file qtestlog.cpp.
References QTestResult::addFailure(), context, failOnWarningList, maxMsgLen, qPrintable, and qsnprintf().
Referenced by messageHandler().
Definition at line 154 of file qtestlog.cpp.
References ignoreResultList, list, mutex, and QTest::IgnoreResultList::next.
Referenced by messageHandler().
|
static |
Definition at line 51 of file qtestresult.cpp.
References QTest::Internal::failed.
Referenced by QTestResult::currentTestFailed(), and QTestResult::finishedCurrentTestDataCleanup().
Ignores messages created by qDebug(), qInfo() or qWarning().
If the message with the corresponding type is outputted, it will be removed from the test log. If the test finished and the message was not outputted, a test failure is appended to the test log.
Example:
The example above tests that QDir::mkdir() outputs the right warning when invoked with an invalid file name.
Definition at line 2177 of file qtestcase.cpp.
References QTestLog::ignoreMessage().
Referenced by tstQDir().
|
static |
Definition at line 173 of file qxmltestlogger.cpp.
Referenced by QXmlTestLogger::addIncident().
|
static |
Definition at line 455 of file qtestcase.cpp.
References invokeTestMethodIfValid(), metaObject(), and methodName().
Referenced by qPrintDataTags().
|
static |
Definition at line 443 of file qtestcase.cpp.
References ok.
Referenced by invokeTestMethodIfExists(), and QTest::TestMethods::invokeTests().
|
inlinestatic |
Definition at line 168 of file qxmltestlogger.cpp.
References str.
Referenced by QXmlTestLogger::addIncident(), QXmlTestLogger::addMessage(), and classIsIgnored().
|
noexcept |
Definition at line 186 of file qbenchmark.cpp.
References QBenchmarkTestMethodData::current.
Referenced by QTest::QBenchmarkIterationController::isDone().
|
inlinestatic |
Definition at line 127 of file qtestkeyboard.h.
References Click, keyEvent(), and window().
|
inlinestatic |
Definition at line 125 of file qtestkeyboard.h.
References Click, keyEvent(), and window().
Referenced by QQuickDialogTestUtils::enterText(), QuickTestEvent::keyClick(), and QuickTestEvent::keyClickChar().
|
inlinestatic |
Definition at line 118 of file qtestkeyboard.h.
References asciiToKey(), sendKeyEvent(), and window().
Referenced by keyClick(), keyClick(), keyPress(), keyPress(), keyRelease(), and keyRelease().
|
inlinestatic |
Definition at line 121 of file qtestkeyboard.h.
References keyToAscii(), sendKeyEvent(), and window().
|
inlinestatic |
Definition at line 133 of file qtestkeyboard.h.
References keyEvent(), Press, and window().
Referenced by QuickTestEvent::keyPress(), and QuickTestEvent::keyPressChar().
|
inlinestatic |
Definition at line 135 of file qtestkeyboard.h.
References keyEvent(), Press, and window().
|
inlinestatic |
Definition at line 129 of file qtestkeyboard.h.
References keyEvent(), Release, and window().
Referenced by QuickTestEvent::keyRelease(), and QuickTestEvent::keyReleaseChar().
|
inlinestatic |
Definition at line 131 of file qtestkeyboard.h.
References keyEvent(), Release, and window().
char QTest::keyToAscii | ( | Qt::Key | key | ) |
Convert a Qt Key to an ascii char value. If the Qt key is unknown a 0 is returned.
Note: this may happen more than you like since not all known Qt keys are converted already. So feel free to add all the keys you need.
Definition at line 203 of file qasciikey.cpp.
References Qt::Key_0, Qt::Key_1, Qt::Key_2, Qt::Key_3, Qt::Key_4, Qt::Key_5, Qt::Key_6, Qt::Key_7, Qt::Key_8, Qt::Key_9, Qt::Key_A, Qt::Key_Aacute, Qt::Key_Acircumflex, Qt::Key_acute, Qt::Key_Adiaeresis, Qt::Key_AE, Qt::Key_Agrave, Qt::Key_Alt, Qt::Key_Ampersand, Qt::Key_Apostrophe, Qt::Key_Aring, Qt::Key_AsciiCircum, Qt::Key_AsciiTilde, Qt::Key_Asterisk, Qt::Key_At, Qt::Key_Atilde, Qt::Key_B, Qt::Key_Back, Qt::Key_Backslash, Qt::Key_Backspace, Qt::Key_Backtab, Qt::Key_Bar, Qt::Key_BassBoost, Qt::Key_BassDown, Qt::Key_BassUp, Qt::Key_BraceLeft, Qt::Key_BraceRight, Qt::Key_BracketLeft, Qt::Key_BracketRight, Qt::Key_brokenbar, Qt::Key_C, Qt::Key_CapsLock, Qt::Key_Ccedilla, Qt::Key_cedilla, Qt::Key_cent, Qt::Key_Clear, Qt::Key_Colon, Qt::Key_Comma, Qt::Key_Control, Qt::Key_copyright, Qt::Key_currency, Qt::Key_D, Qt::Key_degree, Qt::Key_Delete, Qt::Key_diaeresis, Qt::Key_Direction_L, Qt::Key_Direction_R, Qt::Key_division, Qt::Key_Dollar, Qt::Key_Down, Qt::Key_E, Qt::Key_Eacute, Qt::Key_Ecircumflex, Qt::Key_Ediaeresis, Qt::Key_Egrave, Qt::Key_End, Qt::Key_Enter, Qt::Key_Equal, Qt::Key_Escape, Qt::Key_ETH, Qt::Key_Exclam, Qt::Key_exclamdown, Qt::Key_F, Qt::Key_F1, Qt::Key_F10, Qt::Key_F11, Qt::Key_F12, Qt::Key_F13, Qt::Key_F14, Qt::Key_F15, Qt::Key_F16, Qt::Key_F17, Qt::Key_F18, Qt::Key_F19, Qt::Key_F2, Qt::Key_F20, Qt::Key_F21, Qt::Key_F22, Qt::Key_F23, Qt::Key_F24, Qt::Key_F25, Qt::Key_F26, Qt::Key_F27, Qt::Key_F28, Qt::Key_F29, Qt::Key_F3, Qt::Key_F30, Qt::Key_F31, Qt::Key_F32, Qt::Key_F33, Qt::Key_F34, Qt::Key_F35, Qt::Key_F4, Qt::Key_F5, Qt::Key_F6, Qt::Key_F7, Qt::Key_F8, Qt::Key_F9, Qt::Key_Favorites, Qt::Key_Forward, Qt::Key_G, Qt::Key_Greater, Qt::Key_guillemotleft, Qt::Key_guillemotright, Qt::Key_H, Qt::Key_Help, Qt::Key_Home, Qt::Key_HomePage, Qt::Key_Hyper_L, Qt::Key_Hyper_R, Qt::Key_hyphen, Qt::Key_I, Qt::Key_Iacute, Qt::Key_Icircumflex, Qt::Key_Idiaeresis, Qt::Key_Igrave, Qt::Key_Insert, Qt::Key_J, Qt::Key_K, Qt::Key_L, Qt::Key_Launch0, Qt::Key_Launch1, Qt::Key_Launch2, Qt::Key_Launch3, Qt::Key_Launch4, Qt::Key_Launch5, Qt::Key_Launch6, Qt::Key_Launch7, Qt::Key_Launch8, Qt::Key_Launch9, Qt::Key_LaunchA, Qt::Key_LaunchB, Qt::Key_LaunchC, Qt::Key_LaunchD, Qt::Key_LaunchE, Qt::Key_LaunchF, Qt::Key_LaunchMail, Qt::Key_LaunchMedia, Qt::Key_Left, Qt::Key_Less, Qt::Key_M, Qt::Key_macron, Qt::Key_masculine, Qt::Key_MediaNext, Qt::Key_MediaPlay, Qt::Key_MediaPrevious, Qt::Key_MediaRecord, Qt::Key_MediaStop, Qt::Key_Menu, Qt::Key_Meta, Qt::Key_micro, Qt::Key_Minus, Qt::Key_multiply, Qt::Key_N, Qt::Key_No, Qt::Key_nobreakspace, Qt::Key_notsign, Qt::Key_Ntilde, Qt::Key_NumberSign, Qt::Key_NumLock, Qt::Key_O, Qt::Key_Oacute, Qt::Key_Ocircumflex, Qt::Key_Odiaeresis, Qt::Key_Ograve, Qt::Key_onehalf, Qt::Key_onequarter, Qt::Key_onesuperior, Qt::Key_Ooblique, Qt::Key_OpenUrl, Qt::Key_ordfeminine, Qt::Key_Otilde, Qt::Key_P, Qt::Key_PageDown, Qt::Key_PageUp, Qt::Key_paragraph, Qt::Key_ParenLeft, Qt::Key_ParenRight, Qt::Key_Pause, Qt::Key_Percent, Qt::Key_Period, Qt::Key_periodcentered, Qt::Key_Plus, Qt::Key_plusminus, Qt::Key_Print, Qt::Key_Q, Qt::Key_Question, Qt::Key_questiondown, Qt::Key_QuoteDbl, Qt::Key_QuoteLeft, Qt::Key_R, Qt::Key_Refresh, Qt::Key_registered, Qt::Key_Return, Qt::Key_Right, Qt::Key_S, Qt::Key_ScrollLock, Qt::Key_Search, Qt::Key_section, Qt::Key_Select, Qt::Key_Semicolon, Qt::Key_Shift, Qt::Key_Slash, Qt::Key_Space, Qt::Key_ssharp, Qt::Key_Standby, Qt::Key_sterling, Qt::Key_Stop, Qt::Key_Super_L, Qt::Key_Super_R, Qt::Key_SysReq, Qt::Key_T, Qt::Key_Tab, Qt::Key_THORN, Qt::Key_threequarters, Qt::Key_threesuperior, Qt::Key_TrebleDown, Qt::Key_TrebleUp, Qt::Key_twosuperior, Qt::Key_U, Qt::Key_Uacute, Qt::Key_Ucircumflex, Qt::Key_Udiaeresis, Qt::Key_Ugrave, Qt::Key_Underscore, Qt::Key_Up, Qt::Key_V, Qt::Key_VolumeDown, Qt::Key_VolumeMute, Qt::Key_VolumeUp, Qt::Key_W, Qt::Key_X, Qt::Key_Y, Qt::Key_Yacute, Qt::Key_ydiaeresis, Qt::Key_yen, Qt::Key_Yes, Qt::Key_Z, and QTEST_ASSERT.
Referenced by keyEvent().
|
static |
Definition at line 197 of file qxmltestlogger.cpp.
Referenced by QXmlTestLogger::addMessage().
|
static |
Definition at line 206 of file qtestlog.cpp.
References QTestResult::addFailure(), context, FOREACH_TEST_LOGGER, handleFailOnWarning(), handleIgnoredMessage(), QTestLog::hasLoggers(), QTestLog::leaveTestFunction(), maxWarnings, oldMessageHandler, Q_BASIC_ATOMIC_INITIALIZER, qInstallMessageHandler(), QStringLiteral, QTEST_ASSERT, QtFatalMsg, QtWarningMsg, QTestLog::stopLogging(), and QAbstractTestLogger::Warn.
Referenced by QTestLog::startLogging().
|
inline |
Definition at line 137 of file qtestmouse.h.
References button, MouseClick, mouseEvent(), pos, and window().
Referenced by QQuickControlsTestUtils::clickButton().
|
inline |
Definition at line 141 of file qtestmouse.h.
References button, MouseDClick, mouseEvent(), pos, and window().
Referenced by QQuickControlsTestUtils::doubleClickButton().
|
static |
This function creates a QPA mouse event of type specified by action and calls QWindowSystemInterface::handleMouseEvent(), simulating the windowing system and bypassing the platform plugin. delay is the amount of time to be added to the simulated clock so that QInputEvent::timestamp() will be greater than that of the previous event. We expect all event-handling code to rely on the event timestamps, not the system clock; therefore tests can be run faster than real-time.
If delay is not given, a default minimum mouse delay is used, and unintended double-click events are prevented by incrementing the timestamp by 500ms after each mouse release. Therefore, to test double-clicks, it's necessary to give a realistic delay value (for example, 10ms).
Definition at line 67 of file qtestmouse.h.
References button, defaultMouseDelay(), global, QSize::height(), Qt::KeyboardModifierMask, lastMouseTimestamp, QEvent::MouseButtonPress, QEvent::MouseButtonRelease, MouseClick, MouseDClick, mouseDoubleClickInterval, QEvent::MouseMove, MouseMove, MousePress, MouseRelease, Qt::NoButton, pos, Q_FALLTHROUGH, qApp, qMax(), qt_handleMouseEvent(), QTEST_ASSERT, qWarning, QSize::width(), and window().
Referenced by mouseClick(), mouseDClick(), mouseMove(), mousePress(), and mouseRelease().
Definition at line 145 of file qtestmouse.h.
References mouseEvent(), MouseMove, Qt::NoButton, pos, and window().
Referenced by QQuickViewTestUtils::flick(), QQuickViewTestUtils::moveAndPress(), QQuickViewTestUtils::moveAndRelease(), and QQuickTest::pointerMove().
|
inline |
Definition at line 129 of file qtestmouse.h.
References button, mouseEvent(), MousePress, pos, and window().
Referenced by QQuickViewTestUtils::moveAndPress(), and QQuickTest::pointerPress().
|
inline |
Definition at line 133 of file qtestmouse.h.
References button, mouseEvent(), MouseRelease, pos, and window().
Referenced by QQuickViewTestUtils::moveAndRelease(), and QQuickTest::pointerRelease().
QTestData & QTest::newRow | ( | const char * | dataTag | ) |
Appends a new row to the current test data.
The test output will identify the test run with this test data using the name dataTag.
Returns a QTestData reference that can be used to stream in data, one value for each column in the table.
Example:
See \l {Chapter 2: Data Driven Testing}{Data Driven Testing} for a more extensive example.
Definition at line 2573 of file qtestcase.cpp.
References QTestTable::currentTestTable(), and QTEST_ASSERT_X.
Referenced by MyTestClass::addDataRow(), MyTestClass::addSingleStringRows(), QQuickControlsTestUtils::addTestRowForEachControl(), QuickTestResult::setDataTag(), tst_Skip::test_data(), and TestQString::toInt_data().
|
static |
Definition at line 1282 of file qtestcase.cpp.
References QTestTable::dataCount(), QTestData::dataTag(), i, tag, and QTestTable::testData().
|
static |
Definition at line 106 of file qplaintestlogger.cpp.
References QAbstractTestLogger::BlacklistedFail, QAbstractTestLogger::BlacklistedPass, QAbstractTestLogger::BlacklistedXFail, QAbstractTestLogger::BlacklistedXPass, QAbstractTestLogger::Fail, QAbstractTestLogger::Pass, QAbstractTestLogger::Skip, QAbstractTestLogger::XFail, and QAbstractTestLogger::XPass.
Referenced by QPlainTestLogger::addIncident().
|
static |
Definition at line 136 of file qplaintestlogger.cpp.
References QAbstractTestLogger::Info, QAbstractTestLogger::QCritical, QAbstractTestLogger::QDebug, QAbstractTestLogger::QFatal, QAbstractTestLogger::QInfo, QAbstractTestLogger::QWarning, and QAbstractTestLogger::Warn.
Referenced by QPlainTestLogger::addMessage(), and QPlainTestLogger::enterTestFunction().
QTest::Q_GLOBAL_STATIC | ( | TestRegistry | , |
g_registry | ) |
void QTest::qCaught | ( | const char * | expected, |
const char * | file, | ||
int | line ) |
Contains the implementation of the catch(...) block of QVERIFY_THROWS_EXCEPTION.
The function inspects std::current_exception() by rethrowing it using std::rethrow_exception().
The function must be called from a catch handler.
If the exception inherits std::exception, its what() message is logged and this function returns normally. The caller of this function must then execute a {QTEST_FAIL_ACTION} to exit from the test function.
Otherwise, a message saying an unknown exception was caught is logged and this function rethrows the exception, skipping the {QTEST_FAIL_ACTION} that follows this function call in the caller.
Definition at line 2135 of file qtestcase.cpp.
References expected, file, line, and qCaught().
void QTest::qCaught | ( | const char * | expected, |
const char * | what, | ||
const char * | file, | ||
int | line ) |
Executes qFail() following a failed QVERIFY_THROWS_EXCEPTION or QVERIFY_THROWS_NO_EXCEPTION, passing a suitable message created from expected, what, along with file and line.
The expected parameter contains the type of the exception that is expected to be thrown, or \nullptr, if no exception was expected.
The what parameter contains the result of {std::exception::what()}, or nullptr, if a non-
{std::exception}-derived exception was caught.
The file and line parameters hold expansions of the {FILE} and
{LINE} macros, respectively.
Definition at line 2099 of file qtestcase.cpp.
References QString::asprintf(), expected, file, line, and qFail().
Referenced by qCaught().
void QTest::qCleanup | ( | ) |
Definition at line 1981 of file qtestcase.cpp.
References QBenchmarkGlobalData::CallgrindParentProcess, QBenchmarkGlobalData::current, currentTestObject, and QTestLog::stopLogging().
Referenced by qExec(), qRun(), and runTests().
|
inline |
Definition at line 682 of file qtestcase.h.
References compare_string_helper(), expected, file, line, and t2.
|
inline |
Definition at line 691 of file qtestcase.h.
References compare_string_helper(), expected, file, line, and t2.
|
inline |
Definition at line 696 of file qtestcase.h.
References compare_string_helper(), expected, file, line, and t2.
|
inline |
Definition at line 677 of file qtestcase.h.
References compare_string_helper(), expected, file, line, and t2.
bool QTest::qCompare | ( | const QLatin1StringView & | t1, |
QStringView | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2963 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, line, and t2.
|
inline |
Definition at line 536 of file qtestcase.h.
References expected, file, line, qCompare(), and t2.
|
inline |
Definition at line 639 of file qtestcase.h.
References compare_ptr_helper(), expected, file, line, and t2.
|
inline |
Definition at line 614 of file qtestcase.h.
References compare_helper(), expected, file, QTest::Internal::genericToString(), line, and t2.
|
inline |
Definition at line 665 of file qtestcase.h.
References compare_ptr_helper(), expected, file, line, and t2.
bool QTest::qCompare | ( | double const & | t1, |
double const & | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2888 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, floatingCompare(), line, and t2.
|
inline |
Definition at line 626 of file qtestcase.h.
References expected, file, line, qCompare(), and t2.
|
inline |
Definition at line 632 of file qtestcase.h.
References expected, file, line, qCompare(), and t2.
bool QTest::qCompare | ( | float const & | t1, |
float const & | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2877 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, floatingCompare(), line, and t2.
bool QTest::qCompare | ( | int | t1, |
int | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2900 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, line, and t2.
|
inline |
|
inline |
bool QTest::qCompare | ( | qfloat16 const & | t1, |
qfloat16 const & | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2864 of file qtestcase.cpp.
References compare_helper(), expected, file, floatingCompare(), line, and t2.
|
inline |
Definition at line 117 of file qtest_gui.h.
References expected, file, line, qCompare(), QTEST_ASSERT, and t2.
|
inline |
Definition at line 125 of file qtest_gui.h.
References compare_helper(), expected, file, line, qFuzzyCompare(), qsnprintf(), and t2.
|
inline |
bool QTest::qCompare | ( | QList< T > const & | t1, |
const T(&) | t2[N], | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
bool QTest::qCompare | ( | QList< T > const & | t1, |
std::initializer_list< T > | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
|
inline |
Definition at line 167 of file qtest_gui.h.
References compare_helper(), expected, file, line, qCompare(), qFuzzyCompare(), qsnprintf(), and t2.
|
inline |
Definition at line 31 of file qtest.h.
References expected, file, line, qCompare(), and t2.
Referenced by qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), qCompare(), and qTest().
bool QTest::qCompare | ( | QStringView | t1, |
const QLatin1StringView & | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2951 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, line, and t2.
bool QTest::qCompare | ( | QStringView | t1, |
QStringView | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2939 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, line, and t2.
|
inline |
Definition at line 658 of file qtestcase.h.
References compare_ptr_helper(), expected, file, line, and t2.
|
inline |
Definition at line 652 of file qtestcase.h.
References compare_ptr_helper(), expected, file, and line.
|
inline |
Definition at line 645 of file qtestcase.h.
References compare_ptr_helper(), expected, file, line, and t2.
|
inline |
Definition at line 671 of file qtestcase.h.
References compare_ptr_helper(), expected, file, line, and t2.
bool QTest::qCompare | ( | unsigned | t1, |
unsigned | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line ) |
Definition at line 2927 of file qtestcase.cpp.
References QTestResult::compare(), expected, file, line, and t2.
|
inline |
Definition at line 725 of file qtestcase.h.
References file, QTest::Internal::genericToString(), line, and reportResult().
void * QTest::qData | ( | const char * | tagName, |
int | typeId ) |
Definition at line 2515 of file qtestcase.cpp.
References QTestResult::currentTestData(), and fetchData().
void * QTest::qElementData | ( | const char * | tagName, |
int | metaTypeId ) |
Definition at line 2529 of file qtestcase.cpp.
References QTestResult::currentTestData(), and QTEST_ASSERT.
Referenced by qTest().
int QTest::qExec | ( | QObject * | testObject, |
const QStringList & | arguments ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Behaves identically to qExec(QObject *, int, char**) but takes a QStringList of arguments instead of a char**
list.
Definition at line 2033 of file qtestcase.cpp.
References QList< T >::append(), args, arguments, QList< T >::at(), QVariant::constData(), i, QList< T >::last(), qExec(), QList< T >::reserve(), QList< T >::size(), and testObject().
Executes tests declared in testObject.
In addition, the private slots {initTestCase()},
{cleanupTestCase()},
{init()} and
{cleanup()} are executed if they exist. See \l{Creating a Test} for more details.
Optionally, the command line arguments argc and argv can be provided. For a list of recognized arguments, read \l {Qt Test Command Line Arguments}.
The following example will run all tests in MyTestObject:
This function returns 0 if no tests failed, or a value other than 0 if one or more tests failed or in case of unhandled exceptions. (Skipped tests do not influence the return value.)
For stand-alone test applications, the convenience macro \l QTEST_MAIN() can be used to declare a main() function that parses the command line arguments and executes the tests, avoiding the need to call this function explicitly.
The return value from this function is also the exit code of the test application when the \l QTEST_MAIN() macro is used.
For stand-alone test applications, this function should not be called more than once, as command-line options for logging test output to files and executing individual test functions will not behave correctly.
If you have programmatically created the arguments, as opposed to getting them from the arguments in main()
, it is likely of interest to use QTest::qExec(QObject *, const QStringList &) since it is Unicode safe.
Definition at line 1820 of file qtestcase.cpp.
References Module, qCleanup(), qInit(), qRun(), ret, and testObject().
Referenced by qExec(), and testObject().
bool QTest::qExpectFail | ( | const char * | dataIndex, |
const char * | comment, | ||
QTest::TestFailMode | mode, | ||
const char * | file, | ||
int | line ) |
Definition at line 2077 of file qtestcase.cpp.
References QTestResult::expectFail(), file, line, and qstrdup().
void QTest::qFail | ( | const char * | message, |
const char * | file, | ||
int | line ) |
Definition at line 2052 of file qtestcase.cpp.
References QTestResult::fail(), file, and line.
Referenced by qCaught().
QString QTest::qFindTestData | ( | const char * | base, |
const char * | file = nullptr, | ||
int | line = 0, | ||
const char * | builddir = nullptr, | ||
const char * | sourcedir = nullptr ) |
Definition at line 2507 of file qtestcase.cpp.
References base, QFile::decodeName(), file, line, and qFindTestData().
Referenced by QTestPrivate::parseBlackList(), and qFindTestData().
QString QTest::qFindTestData | ( | const QString & | base, |
const char * | file = nullptr, | ||
int | line = 0, | ||
const char * | builddir = nullptr, | ||
const char * | sourcedir = nullptr ) |
Definition at line 2370 of file qtestcase.cpp.
References QCoreApplication::applicationDirPath(), QString::arg(), arg, base, canonicalPath(), QDir::currentPath(), QTestResult::currentTestObjectName(), QFile::decodeName(), QFileInfo::exists(), file, QTestLog::info(), line, mainSourcePath, QLibraryInfo::path(), qApp, qPrintable, qstrncmp(), QLibraryInfo::TestsPath, QDir::toNativeSeparators(), QTestLog::verboseLevel(), and QTestLog::warn().
void * QTest::qGlobalData | ( | const char * | tagName, |
int | typeId ) |
Definition at line 2522 of file qtestcase.cpp.
References QTestResult::currentGlobalTestData(), and fetchData().
Definition at line 1842 of file qtestcase.cpp.
References QBenchmarkGlobalData::CallgrindParentProcess, QBenchmarkGlobalData::current, currentTestObject, QTestPrivate::disableWindowRestore(), initEnvironment(), metaObject(), QTestPrivate::parseBlackList(), qApp, qstrcmp(), QTEST_ASSERT, qtest_qParseArgs(), QTestResult::reset(), QTestResult::setCurrentAppName(), QTestResult::setCurrentTestObject(), QTestLog::startLogging(), and testObject().
Referenced by runTests().
|
static |
Definition at line 1023 of file qtestcase.cpp.
|
static |
Definition at line 537 of file qtestcase.cpp.
References QByteArray::constData(), currentTestObject, QByteArray::data(), QTestTable::dataCount(), QTestData::dataTag(), QTestTable::globalTestTable(), i, invokeTestMethodIfExists(), isValidSlot(), j, QMetaMethod::methodSignature(), qsnprintf(), qstrdup(), qstrlen(), QByteArray::resize(), QTestLog::setPrintAvailableTagsMode(), QByteArray::size(), and QTestTable::testData().
Referenced by qtest_qParseArgs().
|
inlinestatic |
Definition at line 21 of file qsignaldumper.cpp.
References ba, QByteArray::constData(), and QTestLog::info().
Referenced by qSignalDumperCallback(), and qSignalDumperCallbackSlot().
|
static |
Definition at line 516 of file qtestcase.cpp.
References Qt::CaseInsensitive, QLatin1StringView::contains(), currentTestObject, i, isValidSlot(), matches(), and preamble.
Referenced by qRun(), and qtest_qParseArgs().
int QTest::qRun | ( | ) |
Definition at line 1886 of file qtestcase.cpp.
References QTestResult::addFailure(), QCoreApplication::arguments(), QBenchmarkGlobalData::CallgrindParentProcess, QBenchmarkValgrindUtils::cleanup(), QTestTable::clearGlobalTestTable(), QBenchmarkGlobalData::current, QTestResult::currentAppName(), QTestResult::currentTestFunction(), currentTestObject, QTestLog::failCount(), QTestResult::finishedCurrentTestFunction(), QTestTable::globalTestTable(), QTest::TestMethods::invokeTests(), isValidSlot(), Q_UNLIKELY, qApp, QByteArrayLiteral, qCleanup(), qFatal, qMin(), qPrintable, qPrintTestSlots(), QTEST_ASSERT, repeatForever, repetitions, QBenchmarkValgrindUtils::rerunThroughCallgrind(), QTestResult::setCurrentTestFunction(), testFunctions, and testTags.
Referenced by qExec(), and runTests().
|
static |
Definition at line 42 of file qsignaldumper.cpp.
References QString::append(), arg, args, QList< T >::at(), QString::chop(), classIsIgnored(), QString::endsWith(), QString::fill(), QMetaType::fromName(), i, ignoreLevel, iLevel, IndentSpacesCount, QString::isEmpty(), QMetaMethod::isValid(), mo, QMetaMethod::name(), QByteArray::number(), QMetaMethod::parameterTypes(), Q_ASSERT, Q_UNUSED, qPrintMessage(), QMetaObjectPrivate::signal(), QList< T >::size(), str, QString::toLocal8Bit(), toLocal8Bit(), toString(), and QMetaType::UnknownType.
Referenced by QSignalDumper::startDump().
Definition at line 132 of file qsignaldumper.cpp.
References classIsIgnored(), ignoreLevel, iLevel, and Q_ASSERT.
Referenced by QSignalDumper::startDump().
|
static |
Definition at line 101 of file qsignaldumper.cpp.
References classIsIgnored(), QString::fill(), ignoreLevel, iLevel, IndentSpacesCount, QString::isEmpty(), QMetaMethod::isValid(), QMetaMethod::methodSignature(), mo, QByteArray::number(), Q_ASSERT, Q_UNUSED, qPrintMessage(), str, and QString::toLocal8Bit().
Referenced by QSignalDumper::startDump().
void QTest::qSkip | ( | const char * | message, |
const char * | file, | ||
int | line ) |
Definition at line 2068 of file qtestcase.cpp.
References QTestResult::addSkip(), file, line, and QTestResult::setSkipCurrentTest().
QT_BEGIN_NAMESPACE void QTest::qSleep | ( | int | ms | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sleeps for ms milliseconds, blocking execution of the test.
Equivalent to calling:
Definition at line 22 of file qtestsupport_core.cpp.
References qSleep().
Referenced by qSleep(), quarterSecondSleep(), qWait(), and QuickTestResult::sleep().
void QTest::qSleep | ( | std::chrono::milliseconds | msecs | ) |
Sleeps for msecs, blocking execution of the test.
This method will not do any event processing and will leave your test unresponsive. Network communication might time out while sleeping. Use \l {QTest::qWait()} to do non-blocking sleeping.
msecs must be greater than 0ms.
{std::this_thread::sleep_for}
, so the accuracy of time spent depends on the Standard Library implementation. Before Qt 6.7 this function called either nanosleep()
on Unix or Sleep()
on Windows, so the accuracy of time spent in this function depended on the operating system.Example:
Definition at line 49 of file qtestsupport_core.cpp.
References Q_ASSERT.
int QTest::qt_asprintf | ( | QTestCharBuffer * | str, |
const char * | format, | ||
... ) |
Definition at line 397 of file qabstracttestlogger.cpp.
References QString::data(), Q_ASSERT, qt_asprintf(), qvsnprintf(), QString::size(), and str.
Referenced by QXmlTestLogger::addBenchmarkResult(), QTapTestLogger::addIncident(), QTeamCityLogger::addIncident(), QXmlTestLogger::addIncident(), QTapTestLogger::addMessage(), QXmlTestLogger::addMessage(), QXmlTestLogger::enterTestFunction(), QTestJUnitStreamer::formatAfterAttributes(), QTestJUnitStreamer::formatEnd(), QTestJUnitStreamer::formatStart(), QTestPrivate::generateTestIdentifier(), QXmlTestLogger::leaveTestFunction(), qt_asprintf(), QTapTestLogger::startLogging(), QTeamCityLogger::startLogging(), QXmlTestLogger::startLogging(), QTapTestLogger::stopLogging(), QTeamCityLogger::stopLogging(), and QXmlTestLogger::stopLogging().
|
inline |
Definition at line 703 of file qtestcase.h.
References expected, file, line, qCompare(), and qElementData().
void QTest::qtest_qParseArgs | ( | int | argc, |
char * | argv[], | ||
bool | qml ) |
Definition at line 1019 of file qtestcase.cpp.
References qtest_qParseArgs().
Q_TESTLIB_EXPORT void QTest::qtest_qParseArgs | ( | int | argc, |
const char *const | argv[], | ||
bool | qml ) |
Definition at line 615 of file qtestcase.cpp.
References QTestLog::addLogger(), QBenchmarkGlobalData::CallgrindChildProcess, QBenchmarkGlobalData::CallgrindParentProcess, QXcodeTestLogger::canLogTestProgress(), QTestLog::CSV, QBenchmarkGlobalData::current, QTestResult::currentAppName(), QDir::currentPath(), QTestResult::currentTestObjectName(), QBenchmarkGlobalData::EventCounter, eventDelay, QString::fromLatin1(), QTestLog::hasLoggers(), QBenchmarkValgrindUtils::haveValgrind(), i, installCoverageTool(), installedTestCoverage, QBenchmarkPerfEventsMeasurer::isAvailable(), QTestLog::isRepeatSupported(), QTestLog::JUnitXML, keyDelay, QTestLog::LightXML, QBenchmarkPerfEventsMeasurer::listCounters(), QTestLog::loggerUsingStdout(), mouseDelay, QTest::Internal::noCrashHandler, QBenchmarkValgrindUtils::outFileBase(), QXcodeTestLogger::parseCommandLineArgument(), QBenchmarkGlobalData::PerfCounter, QTestLog::Plain, AppleUnifiedLogger::preventsStderrLogging(), printAvailableFunctions, qEnvironmentVariableIsSet(), qPrintDataTags(), qPrintTestSlots(), qToInt(), repeatForever, repetitions, QBenchmarkPerfEventsMeasurer::setCounter(), QSignalDumper::setEnabled(), QTestLog::setInstalledTestCoverage(), QTestLog::setMaxWarnings(), setThrowOnFail(), setThrowOnSkip(), QTestLog::setVerboseLevel(), skipBlacklisted, QTestLog::TAP, QTestLog::TeamCity, testFunctions, testTags, QBenchmarkGlobalData::TickCounter, and QTestLog::XML.
Referenced by QuickTestResult::parseArgs(), qInit(), and qtest_qParseArgs().
|
static |
Definition at line 604 of file qtestcase.cpp.
References str.
Referenced by qtest_qParseArgs().
bool QTest::qVerify | ( | bool | statement, |
const char * | statementStr, | ||
const char * | description, | ||
const char * | file, | ||
int | line ) |
Definition at line 2059 of file qtestcase.cpp.
References file, line, and QTestResult::verify().
Q_CORE_EXPORT void QTest::qWait | ( | int | msecs | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Waits for msecs.
Equivalent to calling:
Definition at line 92 of file qtestsupport_core.cpp.
References qWait().
Referenced by QQuickViewTestUtils::flick(), QQuickTest::initView(), MyObject::isReady(), QtQuickTest::mouseEvent(), QQuickVisualTestUtils::PointLerper::move(), quick_test_main_with_setup(), qWait(), and QuickTestResult::wait().
Q_CORE_EXPORT void QTest::qWait | ( | std::chrono::milliseconds | msecs | ) |
Waits for msecs. While waiting, events will be processed and your test will stay responsive to user interface events or network communication.
Example:
The code above will wait until the network server is responding for a maximum of about 12.5 seconds.
Definition at line 112 of file qtestsupport_core.cpp.
References QEventLoop::AllEvents, deadline, QEvent::DeferredDelete, QDeadlineTimer::hasExpired(), QCoreApplication::instance(), QDeadlineTimer::isForever(), Qt::PreciseTimer, QCoreApplication::processEvents(), Q_ASSERT, qSleep(), QDeadlineTimer::remainingTimeAsDuration(), and QCoreApplication::sendPostedEvents().
template< typename Functor > bool QTest::qWaitFor | ( | Functor | predicate, |
int | timeout ) |
Waits for timeout milliseconds or until the predicate returns true.
This is equivalent to calling:
Definition at line 55 of file qtestsupport_core.h.
References Qt::PreciseTimer, predicate, and qWaitFor().
template< typename Functor > bool QTest::qWaitFor | ( | Functor | predicate, |
QDeadlineTimer | deadline = QDeadlineTimer(std::chrono::seconds{5}) ) |
Waits until deadline has expired, or until predicate returns true, whichever happens first.
Returns true
if predicate returned true at any point, otherwise returns false
.
Example:
The code above will wait for the object to become ready, for a maximum of three seconds.
Definition at line 21 of file qtestsupport_core.h.
Referenced by PlatformQuirks::isClipboardAvailable(), qWaitFor(), QQuickTest::qWaitForPolish(), QQuickTest::qWaitForPolish(), qWaitForSignal(), qWaitForWidgetWindow(), qWaitForWindowActive(), qWaitForWindowExposed(), qWaitForWindowFocused(), and startup().
Q_WIDGETS_EXPORT bool QTest::qWaitForWindowActive | ( | QWidget * | widget, |
int | timeout = 5000 ) |
Returns true
if widget is active within timeout milliseconds. Otherwise returns false
.
The method is useful in tests that call QWidget::show() and rely on the widget actually being active (i.e. being visible and having focus) before proceeding.
false
if another window prevents widget from becoming active.true
.Definition at line 48 of file qtestsupport_widgets.cpp.
References QGuiApplicationPrivate::platformIntegration(), Q_UNLIKELY, qWaitForWidgetWindow(), qWaitForWindowExposed(), qWarning, widget, window(), QWidget::window(), and QPlatformIntegration::WindowActivation.
QT_BEGIN_NAMESPACE Q_GUI_EXPORT bool QTest::qWaitForWindowActive | ( | QWindow * | window, |
int | timeout = 5000 ) |
Returns true
, if window is active within timeout milliseconds. Otherwise returns false
.
The method is useful in tests that call QWindow::show() and rely on the window actually being active (i.e. being visible and having focus) before proceeding.
false
if another window prevents window from becoming active.true
.Definition at line 34 of file qtestsupport_gui.cpp.
References QGuiApplicationPrivate::platformIntegration(), Q_UNLIKELY, qWaitFor(), qWaitForWindowExposed(), qWarning, window(), and QPlatformIntegration::WindowActivation.
Referenced by quick_test_main_with_setup(), and QQuickDialogTestUtils::DialogTestHelper< DialogType, QuickDialogType >::waitForWindowActive().
Q_WIDGETS_EXPORT bool QTest::qWaitForWindowExposed | ( | QWidget * | widget, |
int | timeout = 5000 ) |
Returns true
if widget is exposed within timeout milliseconds. Otherwise returns false
.
The method is useful in tests that call QWidget::show() and rely on the widget actually being being visible before proceeding.
false
.Definition at line 103 of file qtestsupport_widgets.cpp.
References qWaitForWidgetWindow(), widget, window(), and QWidget::window().
Q_GUI_EXPORT bool QTest::qWaitForWindowExposed | ( | QWindow * | window, |
int | timeout = 5000 ) |
Returns true
, if window is exposed within timeout milliseconds. Otherwise returns false
.
The method is useful in tests that call QWindow::show() and rely on the window actually being being visible before proceeding.
false
.Definition at line 82 of file qtestsupport_gui.cpp.
References qWaitFor(), and window().
Referenced by quick_test_main_with_setup(), qWaitForWindowActive(), qWaitForWindowActive(), and QQuickTest::showView().
Q_WIDGETS_EXPORT bool QTest::qWaitForWindowFocused | ( | QWidget * | widget, |
QDeadlineTimer | timeout = std::chrono::seconds{5} ) |
Returns true
, if widget is the focus window within timeout. Otherwise returns false
.
The method is useful in tests that call QWidget::show() and rely on the widget having focus (for receiving keyboard events e.g.) before proceeding.
false
if another window prevents widget from becoming focused.true
.Definition at line 80 of file qtestsupport_widgets.cpp.
References qGuiApp, qWaitForWidgetWindow(), widget, window(), and QWidget::window().
Q_GUI_EXPORT bool QTest::qWaitForWindowFocused | ( | QWindow * | window, |
QDeadlineTimer | timeout = std::chrono::seconds{5} ) |
Returns true
, if window is the focus window within timeout. Otherwise returns false
.
The method is useful in tests that call QWindow::show() and rely on the window having focus (for receiving keyboard events e.g.) before proceeding.
false
if another window prevents window from becoming focused.true
.Definition at line 63 of file qtestsupport_gui.cpp.
References qGuiApp, qWaitFor(), and window().
Q_TESTLIB_EXPORT bool QTest::reportResult | ( | bool | success, |
const void * | lhs, | ||
const void * | rhs, | ||
const char *(*)(const void *) | lhsFormatter, | ||
const char *(*)(const void *) | rhsFormatter, | ||
const char * | lhsExpr, | ||
const char * | rhsExpr, | ||
ComparisonOperation | op, | ||
const char * | file, | ||
int | line ) |
|
static |
Definition at line 46 of file qtestresult.cpp.
References setFailed().
Referenced by QTestResult::finishedCurrentTestDataCleanup(), QTestResult::finishedCurrentTestFunction(), QTestResult::reset(), QTestResult::setCurrentTestData(), and QTestResult::setCurrentTestFunction().
bool QTest::runningTest | ( | ) |
true
during the run of the test-function and its set-up.Used by the {QTRY_*} macros and \l QTestEventLoop to check whether to return when QTest::currentTestResolved() is true.
Definition at line 2720 of file qtestcase.cpp.
References inTestFunction.
Referenced by QTestEventLoop::enterLoop().
|
static |
Definition at line 109 of file qtestkeyboard.h.
References sendKeyEvent(), text, and window().
|
static |
Definition at line 48 of file qtestkeyboard.h.
References Qt::AltModifier, Click, Qt::ControlModifier, QGuiApplication::focusWindow(), Qt::Key_Alt, Qt::Key_Control, Qt::Key_Meta, Qt::Key_Shift, Qt::MetaModifier, Press, ptr(), qApp, qt_sendShortcutOverrideEvent(), QTEST_ASSERT, Release, sendKeyEvent(), Qt::ShiftModifier, Shortcut, simulateEvent(), text, and window().
Referenced by keyEvent(), keyEvent(), sendKeyEvent(), and sendKeyEvent().
void QTest::setBenchmarkResult | ( | qreal | result, |
QTest::QBenchmarkMetric | metric ) |
Sets the benchmark result for this test function to result.
Use this function if you want to report benchmark results without using the QBENCHMARK macro. Use metric to specify how Qt Test should interpret the results.
The context for the result will be the test function name and any data tag from the _data function. This function can only be called once in each test function, subsequent calls will replace the earlier reported results.
Note that the -iterations command line argument has no effect on test functions without the QBENCHMARK macro.
Definition at line 239 of file qbenchmark.cpp.
References QBenchmarkTestMethodData::current.
|
static |
Definition at line 29 of file qtestresult.cpp.
References QTest::Internal::failed, ok, qEnvironmentVariableIntValue(), qEnvironmentVariableIsSet(), and qTerminate().
Referenced by QTestResult::addFailure(), checkStatement(), and resetFailed().
void QTest::setIterationCount | ( | int | count | ) |
Definition at line 200 of file qbenchmark.cpp.
References QBenchmarkTestMethodData::current.
void QTest::setIterationCountHint | ( | int | count | ) |
Definition at line 193 of file qbenchmark.cpp.
References QBenchmarkTestMethodData::current.
Definition at line 2734 of file qtestcase.cpp.
References QFile::decodeName(), file, mainSourcePath, and QFileInfo::setFile().
|
noexcept |
Enables (enable = true
) or disables (\ enable = false
) throwing on QCOMPARE()/QVERIFY() failures (as opposed to just returning from the immediately-surrounding function context).
The feature is reference-counted: If you call this function {N} times with {true}, you need to call it {N} times with
{false} to get back to where you started.
The default is {false}, unless the \l{Qt Test Environment Variables} {QTEST_THROW_ON_FAIL environment variable} is set.
This call has no effect when the \l{QTEST_THROW_ON_FAIL} C++ macro is defined.
Definition at line 325 of file qtestcase.cpp.
References g_throwOnFail.
Referenced by QTest::ThrowOnFailDisabler::ThrowOnFailDisabler(), QTest::ThrowOnFailEnabler::ThrowOnFailEnabler(), QTest::ThrowOnFailDisabler::~ThrowOnFailDisabler(), QTest::ThrowOnFailEnabler::~ThrowOnFailEnabler(), and qtest_qParseArgs().
|
noexcept |
Enables (enable = true
) or disables (\ enable = false
) throwing on QSKIP() (as opposed to just returning from the immediately-surrounding function context).
The feature is reference-counted: If you call this function {N} times with {true}, you need to call it {N} times with
{false} to get back to where you started.
The default is {false}, unless the \l{Qt Test Environment Variables} {QTEST_THROW_ON_SKIP environment variable} is set.
This call has no effect when the \l{QTEST_THROW_ON_SKIP} C++ macro is defined.
Definition at line 352 of file qtestcase.cpp.
References g_throwOnSkip.
Referenced by QTest::ThrowOnSkipDisabler::ThrowOnSkipDisabler(), QTest::ThrowOnSkipEnabler::ThrowOnSkipEnabler(), QTest::ThrowOnSkipDisabler::~ThrowOnSkipDisabler(), QTest::ThrowOnSkipEnabler::~ThrowOnSkipEnabler(), and qtest_qParseArgs().
|
static |
Definition at line 39 of file qtestkeyboard.h.
References QEvent::KeyPress, QEvent::KeyRelease, qApp, qt_handleKeyEvent(), text, and window().
Referenced by QQuickVisualTestUtils::MnemonicKeySimulator::press(), QQuickVisualTestUtils::MnemonicKeySimulator::release(), and sendKeyEvent().
QTest::switch | ( | ch | ) |
Definition at line 1633 of file qtestcase.cpp.
References ch.
|
static |
Definition at line 24 of file qteamcitylogger.cpp.
References QAbstractTestLogger::BlacklistedFail, QAbstractTestLogger::BlacklistedPass, QAbstractTestLogger::BlacklistedXFail, QAbstractTestLogger::BlacklistedXPass, QAbstractTestLogger::Fail, QAbstractTestLogger::Pass, QAbstractTestLogger::Skip, QAbstractTestLogger::XFail, and QAbstractTestLogger::XPass.
Referenced by QTeamCityLogger::addIncident().
|
static |
Definition at line 49 of file qteamcitylogger.cpp.
References QAbstractTestLogger::Info, QAbstractTestLogger::QCritical, QAbstractTestLogger::QDebug, QAbstractTestLogger::QFatal, QAbstractTestLogger::QInfo, QAbstractTestLogger::QWarning, and QAbstractTestLogger::Warn.
Referenced by QTeamCityLogger::addMessage().
QObject * QTest::testObject | ( | ) |
Definition at line 2727 of file qtestcase.cpp.
References currentTestObject.
Referenced by QTest::TestMethods::invokeTests().
Q_TESTLIB_EXPORT char * QTest::toHexRepresentation | ( | const char * | ba, |
qsizetype | length ) |
Returns a pointer to a string that is the string ba represented as a space-separated sequence of hex characters.
If the input is considered too long, it is truncated. A trucation is indicated in the returned string as an ellipsis at the end. The caller has ownership of the returned pointer and must ensure it is later passed to operator delete[].
length is the length of the string ba.
Definition at line 1471 of file qtestcase.cpp.
References at, ba, i, o, qMin(), and qstrdup().
Q_TESTLIB_EXPORT char * QTest::toPrettyCString | ( | const char * | p, |
qsizetype | length ) |
Returns the same QByteArray but with only the ASCII characters still shown; everything else is replaced with {\xHH
}.
Definition at line 1530 of file qtestcase.cpp.
References Q_UNLIKELY.
Referenced by toString().
char * QTest::toPrettyUnicode | ( | QStringView | string | ) |
Returns the same QString but with only the ASCII characters still shown; everything else is replaced with {\uXXXX
}.
Similar to QDebug::putString().
Referenced by toString().
char * QTest::toString | ( | const char * | str | ) |
Definition at line 3120 of file qtestcase.cpp.
References qstrcpy(), and str.
char * QTest::toString | ( | const MyPoint & | point | ) |
Definition at line 24 of file src_qtestlib_qtestcase_snippet.cpp.
References ba, QByteArray::data(), QByteArray::number(), and qstrdup().
Referenced by _q_compareSequence(), QuickTestResult::compare(), QuickTestResult::expectFail(), QuickTestResult::expectFailContinue(), QTest::Internal::QCborValueFormatter::format(), formatFailMessage(), QTest::Internal::genericToString(), QTest::Internal::genericToString< char * >(), QTest::Internal::pointerToString(), qSignalDumperCallback(), QTestPrivate::testReadWritePropertyBasics(), QTestPrivate::testWriteOncePropertyBasics(), toString(), toString(), toString(), toString(), toString(), toString(), toString(), toString(), toString< QHostAddress >(), and tupleToString().
|
inline |
Definition at line 164 of file qtesttostring.h.
References ba, i, QByteArray::size(), and str.
|
inline |
Definition at line 159 of file qtesttostring.h.
References ba, QByteArray::constData(), QByteArray::size(), and toPrettyCString().
|
inline |
Definition at line 442 of file qtesttostring.h.
References QTest::Internal::QCborValueFormatter::format().
|
inline |
Definition at line 197 of file qtesttostring.h.
References toString().
|
inline |
Definition at line 447 of file qtesttostring.h.
References QTest::Internal::QCborValueFormatter::format().
|
inline |
Definition at line 432 of file qtesttostring.h.
References QTest::Internal::QCborValueFormatter::format().
|
inline |
Definition at line 437 of file qtesttostring.h.
References QCborValue(), and toString().
|
inline |
Definition at line 203 of file qtesttostring.h.
References arg, QString::fromLatin1(), QString::number(), qPrintable, qsnprintf(), and qstrdup().
|
inline |
Definition at line 46 of file qtest_gui.h.
References QColor::HexArgb, and qstrdup().
Q_POSITIONING_EXPORT char * QTest::toString | ( | const QGeoAreaMonitorInfo & | info | ) |
Definition at line 396 of file qgeoareamonitorinfo.cpp.
References info, qPrintable, and qstrdup().
Q_POSITIONING_EXPORT char * QTest::toString | ( | const QGeoPositionInfo & | info | ) |
Definition at line 407 of file qgeopositioninfo.cpp.
References info, qPrintable, and qstrdup().
Q_POSITIONING_EXPORT char * QTest::toString | ( | const QGeoSatelliteInfo & | info | ) |
Definition at line 389 of file qgeosatelliteinfo.cpp.
References info, qPrintable, and qstrdup().
|
inline |
Definition at line 154 of file qtesttostring.h.
References str, and toString().
|
inline |
Definition at line 303 of file qtesttostring.h.
References QPartialOrdering::Equivalent, QPartialOrdering::Greater, QPartialOrdering::Less, o, qstrdup(), and QPartialOrdering::Unordered.
|
inline |
Definition at line 223 of file qtesttostring.h.
References qsnprintf(), and qstrdup().
|
inline |
Definition at line 245 of file qtesttostring.h.
References qsnprintf(), and qstrdup().
|
inline |
Definition at line 237 of file qtesttostring.h.
References qsnprintf(), and qstrdup().
|
inline |
Definition at line 259 of file qtesttostring.h.
References qsnprintf(), and qstrdup().
|
inline |
Definition at line 51 of file qtest_gui.h.
References QRegion::begin(), i, QRegion::isEmpty(), QRegion::isNull(), QByteArray::number(), qstrdup(), and QRegion::rectCount().
|
inline |
Definition at line 230 of file qtesttostring.h.
References qsnprintf(), and qstrdup().
|
inline |
Definition at line 252 of file qtesttostring.h.
References qsnprintf(), and qstrdup().
|
inline |
Definition at line 149 of file qtesttostring.h.
References str, and toString().
|
inline |
Definition at line 144 of file qtesttostring.h.
References str, and toPrettyUnicode().
|
inline |
Definition at line 267 of file qtesttostring.h.
References QByteArray::constData(), QUrl::errorString(), QUrl::isValid(), qPrintable, qstrdup(), and QUrl::toEncoded().
|
inline |
Definition at line 274 of file qtesttostring.h.
References QByteArray::constData(), qstrdup(), and QUuid::toByteArray().
|
inline |
Definition at line 279 of file qtesttostring.h.
References QByteArray::number(), and qstrdup().
|
inline |
Definition at line 85 of file qtest_gui.h.
References QByteArray::number(), and qstrdup().
|
inline |
Definition at line 93 of file qtest_gui.h.
References QByteArray::number(), and qstrdup().
|
inline |
Definition at line 101 of file qtest_gui.h.
References QByteArray::number(), and qstrdup().
|
inline |
Definition at line 466 of file qtesttostring.h.
References formatString(), and toString().
|
inline |
Definition at line 486 of file qtesttostring.h.
References tupleToString().
|
inline |
Definition at line 108 of file qtesttostring.h.
References QTest::Internal::toString().
char * QTest::toString | ( | const volatile QObject * | vo | ) |
Definition at line 3142 of file qtestcase.cpp.
References className, o, qPrintable, qsnprintf(), and qstrdup().
char * QTest::toString | ( | const volatile void * | p | ) |
Definition at line 3133 of file qtestcase.cpp.
References qsnprintf().
|
inline |
Definition at line 452 of file qtesttostring.h.
References d, qSetRealNumberPrecision(), and qstrdup().
|
inline |
Definition at line 491 of file qtesttostring.h.
References toString().
|
inline |
Definition at line 32 of file qtest_network.h.
References QAbstractSocket::AnyIPProtocol, QAbstractSocket::IPv4Protocol, QAbstractSocket::IPv6Protocol, qstrdup(), toString(), and QAbstractSocket::UnknownNetworkLayerProtocol.
|
inline |
Definition at line 42 of file qtesttouch.h.
Referenced by QQuickTest::pointerMove(), QQuickTest::pointerPress(), QQuickTest::pointerRelease(), and processTouchEvent().
|
inline |
Definition at line 474 of file qtesttostring.h.
References formatString(), get(), and toString().
Referenced by toString().
|
static |
This function creates a mouse wheel event and calls QWindowSystemInterface::handleWheelEvent(). window is the window that should be receiving the event and pos provides the location of the event in the window's local coordinates. angleDelta contains the wheel rotation angle, while pixelDelta contains the scrolling distance in pixels on screen. The keyboard states at the time of the event are specified by stateKey. The scrolling phase of the event is specified by phase.
Definition at line 42 of file qtestwheel.h.
References global, QSize::height(), QPoint::isNull(), pos, qApp, qt_handleWheelEvent(), QTEST_ASSERT, qWarning, QSize::width(), and window().
|
static |
Definition at line 41 of file qxmltestlogger.cpp.
References QAbstractTestLogger::BlacklistedFail, QAbstractTestLogger::BlacklistedPass, QAbstractTestLogger::BlacklistedXFail, QAbstractTestLogger::BlacklistedXPass, QAbstractTestLogger::Fail, QAbstractTestLogger::Pass, QAbstractTestLogger::Skip, QAbstractTestLogger::XFail, and QAbstractTestLogger::XPass.
Referenced by QXmlTestLogger::addIncident().
|
static |
Definition at line 20 of file qxmltestlogger.cpp.
References QAbstractTestLogger::Info, QAbstractTestLogger::QCritical, QAbstractTestLogger::QDebug, QAbstractTestLogger::QFatal, QAbstractTestLogger::QInfo, QAbstractTestLogger::QWarning, and QAbstractTestLogger::Warn.
Referenced by QXmlTestLogger::addMessage().
|
static |
Definition at line 61 of file qtestresult.cpp.
Referenced by QTestResult::addFailure(), checkStatement(), QTestResult::finishedCurrentTestDataCleanup(), QTestResult::reset(), and QTestResult::setBlacklistCurrentTest().
int QTest::blacklists = 0 |
Definition at line 80 of file qtestlog.cpp.
Referenced by QTestLog::addBFail(), QTestLog::addBPass(), QTestLog::addBXPass(), and QTestLog::blacklistCount().
Definition at line 57 of file qtestresult.cpp.
Referenced by QTestResult::currentGlobalDataTag(), QTestResult::currentGlobalTestData(), QTestResult::reset(), and QTestResult::setCurrentGlobalTestData().
Definition at line 56 of file qtestresult.cpp.
Referenced by QTestResult::currentDataTag(), QTestResult::currentTestData(), isExpectFailData(), QTestResult::reset(), and QTestResult::setCurrentTestData().
|
static |
Definition at line 58 of file qtestresult.cpp.
Referenced by QTestResult::currentTestFunction(), QTestResult::finishedCurrentTestFunction(), QTestResult::reset(), and QTestResult::setCurrentTestFunction().
Definition at line 369 of file qtestcase.cpp.
Referenced by qCleanup(), qInit(), qPrintDataTags(), qPrintTestSlots(), qRun(), and testObject().
|
static |
Definition at line 59 of file qtestresult.cpp.
Referenced by QTestResult::currentTestObjectName(), QTestResult::reset(), and QTestResult::setCurrentTestObject().
enum { ... } QTest::currentTestState |
|
static |
Definition at line 17 of file qbenchmarkmetric.cpp.
Referenced by benchmarkMetricName(), and benchmarkMetricUnit().
|
static |
Definition at line 431 of file qtestcase.cpp.
Referenced by defaultEventDelay(), and qtest_qParseArgs().
|
static |
Definition at line 63 of file qtestresult.cpp.
Referenced by checkStatement(), clearExpectFail(), QTestResult::expectFail(), and QTestResult::reset().
|
static |
Definition at line 64 of file qtestresult.cpp.
Referenced by checkStatement(), clearExpectFail(), compareHelper(), compareHelper(), QTestResult::expectFail(), QTestResult::finishedCurrentTestData(), QTestResult::reportResult(), QTestResult::reset(), and QTestResult::verify().
|
static |
Definition at line 144 of file qtestlog.cpp.
Referenced by QTestLog::clearFailOnWarnings(), QTestLog::failOnWarning(), QTestLog::failOnWarning(), and handleFailOnWarning().
int QTest::fails = 0 |
Definition at line 77 of file qtestlog.cpp.
Referenced by QTestLog::addFail(), QTestLog::addXPass(), QTestLog::failCount(), and QTestLog::resetCounters().
|
static |
Definition at line 198 of file qtestcase.cpp.
Referenced by QTest::Internal::maybeThrowOnFail(), and setThrowOnFail().
|
static |
Definition at line 199 of file qtestcase.cpp.
Referenced by QTest::Internal::maybeThrowOnSkip(), and setThrowOnSkip().
|
static |
Definition at line 27 of file qsignaldumper.cpp.
Referenced by classIsIgnored(), QSignalDumper::clearIgnoredClasses(), and QSignalDumper::ignoreClass().
Q_CONSTINIT thread_local int QTest::ignoreLevel = 0 |
Definition at line 29 of file qsignaldumper.cpp.
Referenced by qSignalDumperCallback(), qSignalDumperCallbackEndSignal(), and qSignalDumperCallbackSlot().
|
static |
Definition at line 141 of file qtestlog.cpp.
Referenced by QTestLog::clearIgnoreMessages(), handleIgnoredMessage(), QTestLog::ignoreMessage(), QTestLog::printUnhandledIgnoreMessages(), and QTestLog::unhandledIgnoreMessages().
Q_CONSTINIT thread_local int QTest::iLevel = 0 |
Definition at line 28 of file qsignaldumper.cpp.
Referenced by qSignalDumperCallback(), qSignalDumperCallbackEndSignal(), and qSignalDumperCallbackSlot().
|
static |
Definition at line 150 of file qtestlog.cpp.
Referenced by QTestLog::installedTestCoverage(), qtest_qParseArgs(), and QTestLog::setInstalledTestCoverage().
|
static |
Definition at line 371 of file qtestcase.cpp.
Referenced by runningTest().
|
static |
Definition at line 429 of file qtestcase.cpp.
Referenced by defaultKeyDelay(), and qtest_qParseArgs().
Q_TESTLIB_EXPORT int QTest::lastMouseTimestamp = 0 |
Definition at line 12 of file qtestmouse.cpp.
Referenced by mouseEvent(), QQuickTest::pointerMove(), QQuickTest::pointerPress(), and QQuickTest::pointerRelease().
|
static |
Definition at line 370 of file qtestcase.cpp.
Referenced by qFindTestData(), and setMainSourcePath().
|
static |
Definition at line 149 of file qtestlog.cpp.
Referenced by messageHandler(), and QTestLog::setMaxWarnings().
|
static |
Definition at line 430 of file qtestcase.cpp.
Referenced by defaultMouseDelay(), and qtest_qParseArgs().
|
static |
Definition at line 49 of file qtestmouse.h.
Referenced by mouseEvent().
|
static |
Definition at line 142 of file qtestlog.cpp.
Referenced by QTestLog::clearIgnoreMessages(), handleIgnoredMessage(), QTestLog::ignoreMessage(), QTestLog::printUnhandledIgnoreMessages(), and QTestLog::unhandledIgnoreMessages().
Definition at line 50 of file qbenchmarkmetric.cpp.
Referenced by benchmarkMetricName(), and benchmarkMetricUnit().
|
static |
Definition at line 152 of file qtestlog.cpp.
Referenced by messageHandler(), QTestLog::startLogging(), and QTestLog::stopLogging().
int QTest::passes = 0 |
Definition at line 78 of file qtestlog.cpp.
Referenced by QTestLog::addPass(), QTestLog::passCount(), and QTestLog::resetCounters().
|
constexpr |
Definition at line 1620 of file qtestcase.cpp.
Referenced by toPrettyUnicode().
|
constexpr |
Definition at line 1618 of file qtestcase.cpp.
Referenced by toPrettyUnicode().
Q_TESTLIB_EXPORT bool QTest::printAvailableFunctions = false |
Definition at line 512 of file qtestcase.cpp.
Referenced by QuickTestUtil::printAvailableFunctions(), qtest_qParseArgs(), and quick_test_main_with_setup().
|
static |
Definition at line 436 of file qtestcase.cpp.
Referenced by qRun(), and qtest_qParseArgs().
|
static |
Definition at line 435 of file qtestcase.cpp.
Referenced by qRun(), and qtest_qParseArgs().
|
static |
Definition at line 437 of file qtestcase.cpp.
Referenced by qtest_qParseArgs().
|
static |
Definition at line 60 of file qtestresult.cpp.
Referenced by QTestResult::finishedCurrentTestDataCleanup(), QTestResult::setSkipCurrentTest(), and QTestResult::skipCurrentTest().
int QTest::skips = 0 |
Definition at line 79 of file qtestlog.cpp.
Referenced by QTestLog::addSkip(), QTestLog::resetCounters(), and QTestLog::skipCount().
Q_TESTLIB_EXPORT QStringList QTest::testFunctions |
Definition at line 513 of file qtestcase.cpp.
Referenced by QuickTestResult::functionsToRun(), qRun(), qtest_qParseArgs(), and quick_test_main_with_setup().
Q_TESTLIB_EXPORT QStringList QTest::testTags |
Definition at line 514 of file qtestcase.cpp.
Referenced by QTest::TestMethods::invokeTests(), qRun(), qtest_qParseArgs(), and QuickTestResult::tagsToRun().
|
static |
Definition at line 148 of file qtestlog.cpp.
Referenced by QTestLog::setVerboseLevel(), and QTestLog::verboseLevel().