summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-21 01:00:10 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-04-22 15:28:01 +0200
commitefd7757154e1fb946a51c7d90b8cbf56b4df8b6d (patch)
treef757e14770d82ee8376fa10006973c0e750b1e16 /tests/benchmarks
parent1c80d056e4f45b4ee7c4863cd792e83c889513c5 (diff)
parente10e5318bc02a48a866b76b6f0b7f268d16af642 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp5
-rw-r--r--tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp7
-rw-r--r--tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp9
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp17
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp9
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp8
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp6
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h5
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h8
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp8
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp3
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h4
12 files changed, 46 insertions, 43 deletions
diff --git a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
index 5bd4bc5520..1fd3b9d5da 100644
--- a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
+++ b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -28,6 +28,7 @@
#include <QtTest/QtTest>
#include <QtCore/QProcess>
+#include <QtCore/QElapsedTimer>
class tst_QProcess : public QObject
{
@@ -50,7 +51,7 @@ void tst_QProcess::echoTest_performance()
QVERIFY(process.waitForStarted());
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
qint64 totalBytes = 0;
diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
index c2ce15f720..fb5b2cdc91 100644
--- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
+++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -29,6 +29,7 @@
#include <qtest.h>
#include <QtCore/qmath.h>
+#include <QtCore/QElapsedTimer>
#include <QtWidgets/QWidget>
#include "benchmarktests.h"
@@ -44,7 +45,7 @@ public:
qreal result() const { return m_result; }
public:
- QTime timer;
+ QElapsedTimer timer;
Benchmark *m_benchmark;
@@ -77,7 +78,7 @@ void BenchWidget::paintEvent(QPaintEvent *)
++m_iteration;
- uint currentElapsed = timer.isNull() ? 0 : timer.elapsed();
+ uint currentElapsed = timer.isValid() ? timer.elapsed() : 0;
timer.restart();
m_total += currentElapsed;
diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
index 1f3f38eaaf..7f0f0190ec 100644
--- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
+++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -32,6 +32,7 @@
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtCore/QTemporaryFile>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QFile>
class qfile_vs_qnetworkaccessmanager : public QObject
@@ -88,7 +89,7 @@ void qfile_vs_qnetworkaccessmanager::qnamFileRead_iteration(QNetworkAccessManage
void qfile_vs_qnetworkaccessmanager::qnamFileRead()
{
QNetworkAccessManager manager;
- QTime t;
+ QElapsedTimer t;
QNetworkRequest request(QUrl::fromLocalFile(testFile.fileName()));
// do 3 dry runs for cache warmup
@@ -121,7 +122,7 @@ void qfile_vs_qnetworkaccessmanager::qnamImmediateFileRead_iteration(QNetworkAcc
void qfile_vs_qnetworkaccessmanager::qnamImmediateFileRead()
{
QNetworkAccessManager manager;
- QTime t;
+ QElapsedTimer t;
QNetworkRequest request(QUrl::fromLocalFile(testFile.fileName()));
// do 3 dry runs for cache warmup
@@ -151,7 +152,7 @@ void qfile_vs_qnetworkaccessmanager::qfileFileRead_iteration()
void qfile_vs_qnetworkaccessmanager::qfileFileRead()
{
- QTime t;
+ QElapsedTimer t;
// do 3 dry runs for cache warmup
qfileFileRead_iteration();
diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 95ee094f00..559ed82834 100644
--- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -31,6 +31,7 @@
#include <qtest.h>
#include <QtTest/QtTest>
#include <QtCore/qrandom.h>
+#include <QtCore/QElapsedTimer>
#include <QtNetwork/qnetworkreply.h>
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkaccessmanager.h>
@@ -93,7 +94,7 @@ protected:
QEventLoop eventLoop;
QTimer::singleShot(timeout, &eventLoop, SLOT(quit()));
- QTime timer;
+ QElapsedTimer timer;
timer.start();
eventLoop.exec();
disconnect(client, SIGNAL(bytesWritten(qint64)), this, 0);
@@ -187,7 +188,7 @@ protected:
DataReader reader(client, false);
QObject::connect(client, SIGNAL(disconnected()), &eventLoop, SLOT(quit()));
- QTime timer;
+ QElapsedTimer timer;
timer.start();
eventLoop.exec();
qint64 elapsed = timer.elapsed();
@@ -280,7 +281,7 @@ protected:
DataReader reader(client, false);
QObject::connect(client, SIGNAL(disconnected()), &eventLoop, SLOT(quit()));
- QTime timer;
+ QElapsedTimer timer;
timer.start();
eventLoop.exec();
qint64 elapsed = timer.elapsed();
@@ -611,7 +612,7 @@ void tst_qnetworkreply::downloadPerformance()
QNetworkReplyPtr reply(manager.get(request));
DataReader reader(reply, false);
- QTime loopTime;
+ QElapsedTimer loopTime;
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
loopTime.start();
QTestEventLoop::instance().enterLoop(40);
@@ -654,7 +655,7 @@ void tst_qnetworkreply::httpUploadPerformance()
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTime time;
+ QElapsedTimer time;
generator.start();
time.start();
QTestEventLoop::instance().enterLoop(40);
@@ -682,7 +683,7 @@ void tst_qnetworkreply::performanceControlRate()
sink.connectToHost("127.0.0.1", sender.serverPort());
DataReader reader(&sink, false);
- QTime loopTime;
+ QElapsedTimer loopTime;
connect(&sink, SIGNAL(disconnected()), &QTestEventLoop::instance(), SLOT(exitLoop()));
loopTime.start();
QTestEventLoop::instance().enterLoop(40);
@@ -720,7 +721,7 @@ void tst_qnetworkreply::httpDownloadPerformance()
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
HttpDownloadPerformanceClient client(reply.data());
- QTime time;
+ QElapsedTimer time;
time.start();
QTestEventLoop::instance().enterLoop(40);
QCOMPARE(reply->error(), QNetworkReply::NoError);
diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
index a9f8634129..f35e5cd3db 100644
--- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -27,6 +27,7 @@
****************************************************************************/
#include <QtTest/QtTest>
+#include <QtCore/QElapsedTimer>
#include <qglobal.h>
#include <qcoreapplication.h>
#include <qtcpsocket.h>
@@ -129,7 +130,7 @@ void tst_QTcpServer::ipv4LoopbackPerformanceTest()
QVERIFY(clientB);
QByteArray buffer(16384, '@');
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
qlonglong totalWritten = 0;
while (stopWatch.elapsed() < 5000) {
@@ -180,7 +181,7 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest()
QVERIFY(clientB);
QByteArray buffer(16384, '@');
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
qlonglong totalWritten = 0;
while (stopWatch.elapsed() < 5000) {
@@ -230,7 +231,7 @@ void tst_QTcpServer::ipv4PerformanceTest()
QVERIFY(clientB);
QByteArray buffer(16384, '@');
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
qlonglong totalWritten = 0;
while (stopWatch.elapsed() < 5000) {
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
index eabe3671e5..0aa73b9e26 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -27,7 +27,7 @@
****************************************************************************/
#include <QDebug>
-#include <QTime>
+#include <QElapsedTimer>
#include "itemrecyclinglist.h"
#include "listitemcontainer.h"
@@ -160,10 +160,10 @@ void ItemRecyclingList::themeChange()
void ItemRecyclingList::keyPressEvent(QKeyEvent *event)
{
- static QTime keyPressInterval = QTime::currentTime();
+ static QElapsedTimer keyPressInterval;
static qreal step = 0.0;
static bool repeat = false;
- int interval = keyPressInterval.elapsed();
+ int interval = keyPressInterval.isValid() ? keyPressInterval.elapsed() : 0;
ScrollBar* sb = verticalScrollBar();
qreal currentValue = sb->sliderPosition();
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
index 8f5782b0b8..d8e778f151 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -132,7 +132,7 @@ qreal MainView::fps()
void MainView::fpsReset()
{
m_frameCount = 0;
- m_fpsFirstTs.start();
+ m_fpsFirstTs = QTime::currentTime();
m_fpsLatestTs = m_fpsFirstTs;
m_fpsUpdated.start();
}
@@ -201,7 +201,7 @@ void MainView::paintEvent (QPaintEvent *event)
emit repainted();
m_frameCount++;
- m_fpsLatestTs.start();
+ m_fpsLatestTs = QTime::currentTime();
if(m_fpsUpdated.elapsed() > 2000) {
updateFps();
m_fpsUpdated.start();
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h
index d7fe404023..8237ff7469 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -31,6 +31,7 @@
#include <QGraphicsView>
#include <QTime>
+#include <QElapsedTimer>
#include <QTimer>
#include "settings.h"
@@ -100,7 +101,7 @@ private:
QTime m_fpsFirstTs;
QTime m_fpsLatestTs;
bool m_OutputFps;
- QTime m_fpsUpdated;
+ QElapsedTimer m_fpsUpdated;
QList<qreal> m_Fpss;
int m_angle;
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h
index cf11c7fa02..c8769f59b2 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -42,7 +42,7 @@
#include <QPoint>
#include <QTimer>
-#include <QTime>
+#include <QElapsedTimer>
#include "scroller.h"
@@ -70,8 +70,8 @@ public:
QPoint m_cursorPos;
QPointF m_speed;
State m_state;
- QTime m_lastCursorTime;
- QTime m_lastFrameTime;
+ QElapsedTimer m_lastCursorTime;
+ QElapsedTimer m_lastFrameTime;
QTimer m_scrollTimer;
int m_scrollSlowAccum;
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
index 941cab8c21..d64f3ac38d 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -29,7 +29,7 @@
#include <QDebug>
#include <QGraphicsLinearLayout>
#include <QFont>
-#include <QTime>
+#include <QElapsedTimer>
#include "simplelist.h"
static const int MinItemWidth = 276;
@@ -99,10 +99,10 @@ void SimpleList::setListItemCaching(bool enable)
void SimpleList::keyPressEvent(QKeyEvent *event)
{
- static QTime keyPressInterval = QTime::currentTime();
+ static QElapsedTimer keyPressInterval;
static qreal step = 0.0;
static bool repeat = false;
- int interval = keyPressInterval.elapsed();
+ int interval = keyPressInterval.isValid() ? keyPressInterval.elapsed() : 0;
ScrollBar* sb = verticalScrollBar();
qreal currentValue = sb->sliderPosition();
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp
index 1eaa5f6578..6b108f7be9 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -65,7 +65,6 @@ void ChipTester::runBenchmark()
{
npaints = 0;
timerId = startTimer(0);
- stopWatch.start();
eventLoop.exec();
killTimer(timerId);
}
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h
index e4c9197142..467c3fb293 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chiptester.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -31,7 +31,6 @@
#include <QtWidgets/QGraphicsView>
#include <QtCore/QEventLoop>
-#include <QtCore/QTime>
QT_FORWARD_DECLARE_CLASS(QGraphicsScene)
QT_FORWARD_DECLARE_CLASS(QGraphicsView)
@@ -66,7 +65,6 @@ private:
int npaints;
int timerId;
QEventLoop eventLoop;
- QTime stopWatch;
Operation operation;
};