diff options
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/doc/src/qttestlib-manual.qdoc | 19 | ||||
-rw-r--r-- | src/testlib/qtest_gui.h | 4 | ||||
-rw-r--r-- | src/testlib/qtestaccessible.h | 8 | ||||
-rw-r--r-- | src/testlib/qtestresult.cpp | 8 |
4 files changed, 25 insertions, 14 deletions
diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc index 13654972ec..4125e63ddc 100644 --- a/src/testlib/doc/src/qttestlib-manual.qdoc +++ b/src/testlib/doc/src/qttestlib-manual.qdoc @@ -315,12 +315,15 @@ \row \li CPU tick counter \li -tickcounter \li Windows, Mac OS X, Linux, many UNIX-like systems. - \row \li Valgrind Callgrind - \li -callgrind - \li Linux (if installed) \row \li Event Counter \li -eventcounter \li All platforms + \row \li Valgrind Callgrind + \li -callgrind + \li Linux (if installed) + \row \li Linux Perf + \li -perf + \li Linux \endtable In short, walltime is always available but requires many repetitions to @@ -335,6 +338,16 @@ that were received by the event loop before they are sent to their corresponding targets (this might include non-Qt events). + The Linux Performance Monitoring solution is available only on Linux and + provides many different counters, which can be selected by passing an + additional option \c {-perfcounter countername}, such as \c {-perfcounter + cache-misses}, \c {-perfcounter branch-misses}, or \c {-perfcounter + l1d-load-misses}. The default counter is \c {cpu-cycles}. The full list of + counters can be obtained by running any benchmark executable with the + option \c -perfcounterlist. + + Note that using the performance counter may require enabling access to non-privileged applications. + \note Depending on the device configuration, tick counters on the Windows CE platform may not be as fine-grained, compared to other platforms. Devices that do not support high-resolution timers default to diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h index a9ac7777c3..7c68b0fd77 100644 --- a/src/testlib/qtest_gui.h +++ b/src/testlib/qtest_gui.h @@ -98,7 +98,7 @@ inline bool qCompare(QImage const &t1, QImage const &t2, } if (t1Null && t2Null) return compare_helper(true, 0, 0, 0, actual, expected, file, line); - if (t1.width() != t2.width() || t2.height() != t2.height()) { + if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QImages differ in size.\n" " Actual (%s): %dx%d\n" " Expected (%s): %dx%d", @@ -132,7 +132,7 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c } if (t1Null && t2Null) return compare_helper(true, 0, 0, 0, actual, expected, file, line); - if (t1.width() != t2.width() || t2.height() != t2.height()) { + if (t1.width() != t2.width() || t1.height() != t2.height()) { qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n" " Actual (%s): %dx%d\n" " Expected (%s): %dx%d", diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h index f27651c3ad..ef6f61bd82 100644 --- a/src/testlib/qtestaccessible.h +++ b/src/testlib/qtestaccessible.h @@ -253,12 +253,10 @@ private: { QString rc; QDebug str = QDebug(&rc).nospace(); - str << "Event " << needle->object() << ", type: " - << needle->type() << ", child: " << needle->child() - << " not found at head of event list of size " << haystack.size() << " :"; + str << "Event " << *needle + << " not found at head of event list of size " << haystack.size() << " :"; Q_FOREACH (const QAccessibleEvent *e, haystack) - str << ' ' << e->object() << ", type: " - << e->type() << ", child: " << e->child(); + str << ' ' << *e; return rc; } diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp index a9abca0ef8..859f6743cd 100644 --- a/src/testlib/qtestresult.cpp +++ b/src/testlib/qtestresult.cpp @@ -51,6 +51,8 @@ #include <string.h> #include <wchar.h> +static const char *currentAppName = 0; + QT_BEGIN_NAMESPACE namespace QTest @@ -64,8 +66,6 @@ namespace QTest static const char *expectFailComment = 0; static int expectFailMode = 0; - - static const char *currentAppName = 0; } void QTestResult::reset() @@ -322,12 +322,12 @@ bool QTestResult::skipCurrentTest() void QTestResult::setCurrentAppName(const char *appName) { - QTest::currentAppName = appName; + ::currentAppName = appName; } const char *QTestResult::currentAppName() { - return QTest::currentAppName; + return ::currentAppName; } QT_END_NAMESPACE |