summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-01 10:27:41 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-02 09:24:11 +0100
commitd7e4980132057aa10e54137114bf65e06c455030 (patch)
tree9d6ae36efa0cf84a612bfec6cf3dd2ea7f7e3446 /src/testlib
parent44c402b4bfba44480382244b8409fb3cf34d7ac1 (diff)
parenta732576a66ff2bbd9c0b41cd5f3505a4d2fbf043 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Blacklist tst_QMenuBar::taskQTBUG46812_doNotLeaveMenubarHighlighted() on macOS. Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/sdk.prf src/angle/src/libEGL/libEGL.pro src/platformsupport/fontdatabases/fontdatabases.pro src/platformsupport/platformsupport.pro src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro tests/auto/widgets/widgets/qmenubar/BLACKLIST tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp Task-number: QTBUG-56853 Change-Id: If58785210feee3550892fc7768cce90e75a2416c
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qbenchmark.cpp1
-rw-r--r--src/testlib/qbenchmarkmeasurement.cpp2
-rw-r--r--src/testlib/qbenchmarkmeasurement_p.h36
-rw-r--r--src/testlib/qbenchmarktimemeasurers_p.h96
-rw-r--r--src/testlib/qtestcase.qdoc6
-rw-r--r--src/testlib/testlib.pro1
6 files changed, 102 insertions, 40 deletions
diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp
index c884d5d740..c933a16c35 100644
--- a/src/testlib/qbenchmark.cpp
+++ b/src/testlib/qbenchmark.cpp
@@ -40,6 +40,7 @@
#include <QtTest/qbenchmark.h>
#include <QtTest/private/qbenchmark_p.h>
#include <QtTest/private/qbenchmarkmetric_p.h>
+#include <QtTest/private/qbenchmarktimemeasurers_p.h>
#include <QtCore/qprocess.h>
#include <QtCore/qdir.h>
diff --git a/src/testlib/qbenchmarkmeasurement.cpp b/src/testlib/qbenchmarkmeasurement.cpp
index ac4d75ce3b..228ab15f99 100644
--- a/src/testlib/qbenchmarkmeasurement.cpp
+++ b/src/testlib/qbenchmarkmeasurement.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include <QtTest/private/qbenchmarkmeasurement_p.h>
+#include <QtTest/private/qbenchmarktimemeasurers_p.h>
#include <QtTest/private/qbenchmark_p.h>
#include <QtTest/private/qbenchmarkmetric_p.h>
#include <QtTest/qbenchmark.h>
diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h
index 1444439e11..8dbfd4b618 100644
--- a/src/testlib/qbenchmarkmeasurement_p.h
+++ b/src/testlib/qbenchmarkmeasurement_p.h
@@ -51,8 +51,6 @@
// We mean it.
//
-#include <QtCore/qelapsedtimer.h>
-#include <QtTest/private/cycle_p.h>
#include <QtTest/qbenchmark.h>
QT_BEGIN_NAMESPACE
@@ -73,40 +71,6 @@ public:
virtual QTest::QBenchmarkMetric metricType() = 0;
};
-class QBenchmarkTimeMeasurer : public QBenchmarkMeasurerBase
-{
-public:
- void start();
- qint64 checkpoint();
- qint64 stop();
- bool isMeasurementAccepted(qint64 measurement);
- int adjustIterationCount(int sugestion);
- int adjustMedianCount(int suggestion);
- bool needsWarmupIteration();
- QTest::QBenchmarkMetric metricType();
-private:
- QElapsedTimer time;
-};
-
-#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h
-
-class QBenchmarkTickMeasurer : public QBenchmarkMeasurerBase
-{
-public:
- void start();
- qint64 checkpoint();
- qint64 stop();
- bool isMeasurementAccepted(qint64 measurement);
- int adjustIterationCount(int);
- int adjustMedianCount(int suggestion);
- bool needsWarmupIteration();
- QTest::QBenchmarkMetric metricType();
-private:
- CycleCounterTicks startTicks;
-};
-
-#endif
-
QT_END_NAMESPACE
#endif // QBENCHMARKMEASUREMENT_P_H
diff --git a/src/testlib/qbenchmarktimemeasurers_p.h b/src/testlib/qbenchmarktimemeasurers_p.h
new file mode 100644
index 0000000000..e5ffb1157d
--- /dev/null
+++ b/src/testlib/qbenchmarktimemeasurers_p.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtTest module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBENCHMARKTIMEMEASURERS_P_H
+#define QBENCHMARKTIMEMEASURERS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtTest/private/qbenchmarkmeasurement_p.h>
+#include <QtCore/qelapsedtimer.h>
+#include <QtTest/private/cycle_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QBenchmarkTimeMeasurer : public QBenchmarkMeasurerBase
+{
+public:
+ void start();
+ qint64 checkpoint();
+ qint64 stop();
+ bool isMeasurementAccepted(qint64 measurement);
+ int adjustIterationCount(int sugestion);
+ int adjustMedianCount(int suggestion);
+ bool needsWarmupIteration();
+ QTest::QBenchmarkMetric metricType();
+private:
+ QElapsedTimer time;
+};
+
+#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h
+
+class QBenchmarkTickMeasurer : public QBenchmarkMeasurerBase
+{
+public:
+ void start();
+ qint64 checkpoint();
+ qint64 stop();
+ bool isMeasurementAccepted(qint64 measurement);
+ int adjustIterationCount(int);
+ int adjustMedianCount(int suggestion);
+ bool needsWarmupIteration();
+ QTest::QBenchmarkMetric metricType();
+private:
+ CycleCounterTicks startTicks;
+};
+
+#endif // HAVE_TICK_COUNTER
+
+QT_END_NAMESPACE
+
+#endif // QBENCHMARKTIMEMEASURERS_P_H
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc
index bee8a0ad93..8f3d140add 100644
--- a/src/testlib/qtestcase.qdoc
+++ b/src/testlib/qtestcase.qdoc
@@ -124,7 +124,7 @@
\relates QTest
The QTRY_VERIFY_WITH_TIMEOUT() macro is similar to QVERIFY(), but checks the \a condition
- repeatedly, until either the condition becomes true or the \a timeout is
+ repeatedly, until either the condition becomes true or the \a timeout (in milliseconds) is
reached. Between each evaluation, events will be processed. If the timeout
is reached, a failure is recorded in the test log and the test won't be
executed further.
@@ -156,7 +156,7 @@
The QTRY_VERIFY2_WITH_TIMEOUT macro is similar to QTRY_VERIFY_WITH_TIMEOUT()
except that it outputs a verbose \a message when \a condition is still false
- after the specified \a timeout. The \a message is a plain C string.
+ after the specified \a timeout (in milliseconds). The \a message is a plain C string.
Example:
\code
@@ -196,7 +196,7 @@
The QTRY_COMPARE_WITH_TIMEOUT() macro is similar to QCOMPARE(), but performs the comparison
of the \a actual and \a expected values repeatedly, until either the two values
- are equal or the \a timeout is reached. Between each comparison, events
+ are equal or the \a timeout (in milliseconds) is reached. Between each comparison, events
will be processed. If the timeout is reached, a failure is recorded in the
test log and the test won't be executed further.
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index d76dbb8c75..5b2205e875 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -14,6 +14,7 @@ QMAKE_DOCS = $$PWD/doc/qttestlib.qdocconf
HEADERS = qbenchmark.h \
qbenchmark_p.h \
qbenchmarkmeasurement_p.h \
+ qbenchmarktimemeasurers_p.h \
qbenchmarkvalgrind_p.h \
qbenchmarkevent_p.h \
qbenchmarkperfevents_p.h \