Qt 4.8
|
#include <QtTest/qtest_global.h>
#include <QtTest/qtestcase.h>
#include <QtTest/qtestdata.h>
#include <QtTest/qbenchmark.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
#include <QtCore/qurl.h>
#include <QtCore/qpoint.h>
#include <QtCore/qsize.h>
#include <QtCore/qrect.h>
#include <QtTest/qtestsystem.h>
#include <QtTest/qtest_gui.h>
Go to the source code of this file.
Namespaces | |
QTest | |
The QTest namespace contains all the functions and declarations that are related to the QTestLib tool. | |
Macros | |
#define | QTEST_APPLESS_MAIN(TestObject) |
Implements a main() function that executes all tests in TestClass. More... | |
#define | QTEST_MAIN(TestObject) |
Implements a main() function that instantiates an application object and the TestClass, and executes all tests in the order they were defined. More... | |
#define | QTEST_NOOP_MAIN |
Implements a main() function with a test class that does absolutely nothing. More... | |
Functions | |
template<> | |
bool | QTest::qCompare (QString const &t1, QLatin1String const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | QTest::qCompare (QLatin1String const &t1, QString const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | QTest::qCompare (QStringList const &t1, QStringList const &t2, 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<> | |
char * | QTest::toString (const QLatin1String &str) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given string. More... | |
template<> | |
char * | QTest::toString (const QString &str) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given string. More... | |
template<> | |
char * | QTest::toString (const QByteArray &ba) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the byte array ba. More... | |
template<> | |
char * | QTest::toString (const QTime &time) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given time. More... | |
template<> | |
char * | QTest::toString (const QDate &date) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given date. More... | |
template<> | |
char * | QTest::toString (const QDateTime &dateTime) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the date and time specified by dateTime. More... | |
template<> | |
char * | QTest::toString (const QChar &c) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given character. More... | |
template<> | |
char * | QTest::toString (const QPoint &p) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given point. More... | |
template<> | |
char * | QTest::toString (const QSize &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given size. More... | |
template<> | |
char * | QTest::toString (const QRect &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given rectangle. More... | |
template<> | |
char * | QTest::toString (const QPointF &p) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given point. More... | |
template<> | |
char * | QTest::toString (const QSizeF &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given size. More... | |
template<> | |
char * | QTest::toString (const QRectF &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given rectangle. More... | |
template<> | |
char * | QTest::toString (const QUrl &uri) |
template<> | |
char * | QTest::toString (const QVariant &v) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given variant. More... | |
#define QTEST_APPLESS_MAIN | ( | TestObject | ) |
Implements a main() function that executes all tests in TestClass.
Behaves like QTEST_MAIN() , but doesn't instantiate a QApplication object. Use this macro for really simple stand-alone non-GUI tests.
#define QTEST_MAIN | ( | TestObject | ) |
Implements a main() function that instantiates an application object and the TestClass, and executes all tests in the order they were defined.
Use this macro to build stand-alone executables.
If QT_GUI_LIB
is defined, the application object will be a QApplication, otherwise it will be a QCoreApplication. If qmake is used and the configuration includes QT += gui
, then QT_GUI_LIB
will be defined automatically.
Note: On platforms that have keypad navigation enabled by default (eg: Symbian), this macro will forcfully disable it to simplify the usage of key events when writing autotests. If you wish to write a test case that uses keypad navigation, you should enable it either in the {initTestCase()}
or {init()}
functions of your test case.
Example:
#define QTEST_NOOP_MAIN |
Implements a main() function with a test class that does absolutely nothing.
Use this macro to create a test that produces valid test output but just doesn't execute any test, for example in conditional compilations: