Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtest.h File Reference

(7e2fa57faf230ef8cb505b95c2bc0e70867ac131)

#include <QtTest/qttestglobal.h>
#include <QtTest/qtestcase.h>
#include <QtTest/qtestdata.h>
#include <QtTest/qtesttostring.h>
#include <QtTest/qbenchmark.h>
#include <cstdio>
#include <initializer_list>
#include <memory>
#include <QtTest/qtestsystem.h>
+ Include dependency graph for qtest.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QTest::Internal::HasInitMain< T >
 

Namespaces

namespace  QTest
 [15]
 
namespace  QTest::Internal
 

Macros

#define QTEST_SET_MAIN_SOURCE_PATH   QTest::setMainSourcePath(__FILE__);
 
#define TESTLIB_SELFCOVERAGE_START(name)
 
#define QTEST_MAIN_WRAPPER(TestObject, ...)
 
#define QTEST_APPLESS_MAIN(TestObject)
 
#define QTEST_QAPP_SETUP(klaz)
 
#define QTEST_MAIN_SETUP()
 
#define QTEST_MAIN(TestObject)
 
#define QTEST_GUILESS_MAIN(TestObject)
 

Functions

template<>
bool QTest::qCompare (QString const &t1, QLatin1StringView const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<>
bool QTest::qCompare (QLatin1StringView const &t1, QString const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<typename ActualIterator, typename ExpectedIterator>
bool QTest::_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 QTest::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 QTest::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 QTest::qCompare (QList< T > const &t1, const T(&t2)[N], const char *actual, const char *expected, const char *file, int line)
 
template<typename T>
bool QTest::qCompare (QFlags< T > const &t1, T const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<typename T>
bool QTest::qCompare (QFlags< T > const &t1, int const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<>
bool QTest::qCompare (qint64 const &t1, qint32 const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<>
bool QTest::qCompare (qint64 const &t1, quint32 const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<>
bool QTest::qCompare (quint64 const &t1, quint32 const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<>
bool QTest::qCompare (qint32 const &t1, qint64 const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<>
bool QTest::qCompare (quint32 const &t1, qint64 const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<>
bool QTest::qCompare (quint32 const &t1, quint64 const &t2, const char *actual, const char *expected, const char *file, int line)
 
template<typename T>
std::enable_if< HasInitMain< T >::value, void >::type QTest::Internal::callInitMain ()
 
template<typename T>
std::enable_if<!HasInitMain< T >::value, void >::type QTest::Internal::callInitMain ()
 

Macro Definition Documentation

◆ QTEST_APPLESS_MAIN

#define QTEST_APPLESS_MAIN ( TestObject)
Value:
QTEST_MAIN_WRAPPER(TestObject)
#define QTEST_MAIN_WRAPPER(TestObject,...)
Definition qtest.h:244

Definition at line 280 of file qtest.h.

◆ QTEST_GUILESS_MAIN

#define QTEST_GUILESS_MAIN ( TestObject)
Value:
\inmodule QtCore
#define QTEST_QAPP_SETUP(klaz)
Definition qtest.h:289

Definition at line 315 of file qtest.h.

◆ QTEST_MAIN

#define QTEST_MAIN ( TestObject)
Value:
#define QTEST_MAIN_SETUP()
Definition qtest.h:308

Definition at line 312 of file qtest.h.

◆ QTEST_MAIN_SETUP

#define QTEST_MAIN_SETUP ( )
Value:

Definition at line 308 of file qtest.h.

◆ QTEST_MAIN_WRAPPER

#define QTEST_MAIN_WRAPPER ( TestObject,
... )
Value:
int main(int argc, char *argv[]) \
{ \
TESTLIB_SELFCOVERAGE_START(#TestObject) \
QT_PREPEND_NAMESPACE(QTest::Internal::callInitMain)<TestObject>(); \
__VA_ARGS__ \
TestObject tc; \
QTEST_SET_MAIN_SOURCE_PATH \
return QTest::qExec(&tc, argc, argv); \
}
int main()
[0]
std::enable_if< HasInitMain< T >::value, void >::type callInitMain()
Definition qtest.h:199
Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc=0, char **argv=nullptr)
Executes tests declared in testObject.
const GLfloat * tc

Definition at line 244 of file qtest.h.

◆ QTEST_QAPP_SETUP

#define QTEST_QAPP_SETUP ( klaz)
Value:
klaz app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true);
@ AA_Use96Dpi
Definition qnamespace.h:442
QApplication app(argc, argv)
[0]

Definition at line 289 of file qtest.h.

◆ QTEST_SET_MAIN_SOURCE_PATH

#define QTEST_SET_MAIN_SOURCE_PATH   QTest::setMainSourcePath(__FILE__);

Definition at line 217 of file qtest.h.

◆ TESTLIB_SELFCOVERAGE_START

#define TESTLIB_SELFCOVERAGE_START ( name)

Definition at line 237 of file qtest.h.