summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/network
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/network')
-rw-r--r--tests/benchmarks/network/CMakeLists.txt23
-rw-r--r--tests/benchmarks/network/access/CMakeLists.txt6
-rw-r--r--tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/CMakeLists.txt16
-rw-r--r--tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp6
-rw-r--r--tests/benchmarks/network/access/qnetworkdiskcache/CMakeLists.txt16
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/CMakeLists.txt18
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp34
-rw-r--r--tests/benchmarks/network/access/qnetworkreply_from_cache/CMakeLists.txt13
-rw-r--r--tests/benchmarks/network/kernel/CMakeLists.txt5
-rw-r--r--tests/benchmarks/network/kernel/qhostinfo/CMakeLists.txt18
-rw-r--r--tests/benchmarks/network/socket/CMakeLists.txt4
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt16
-rw-r--r--tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt16
-rw-r--r--tests/benchmarks/network/ssl/CMakeLists.txt3
-rw-r--r--tests/benchmarks/network/ssl/qsslsocket/CMakeLists.txt16
15 files changed, 176 insertions, 34 deletions
diff --git a/tests/benchmarks/network/CMakeLists.txt b/tests/benchmarks/network/CMakeLists.txt
new file mode 100644
index 0000000000..4175518f34
--- /dev/null
+++ b/tests/benchmarks/network/CMakeLists.txt
@@ -0,0 +1,23 @@
+# Generated from network.pro.
+
+# special case begin
+# SSL library include path is not propagated with private tests which results in
+# test not being able to find the ssl header when they are not in the standard
+# include paths
+if (QT_FEATURE_private_tests)
+ if (QT_FEATURE_openssl AND QT_FEATURE_openssl_linked AND QT_FEATURE_ssl)
+ include_directories($<TARGET_PROPERTY:OpenSSL::SSL,INTERFACE_INCLUDE_DIRECTORIES>)
+ endif()
+
+ if (QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_openssl_linked)
+ include_directories($<TARGET_PROPERTY:${INSTALL_CMAKE_NAMESPACE}::SSL_nolink,INTERFACE_INCLUDE_DIRECTORIES>)
+ endif()
+endif()
+# special case end
+
+add_subdirectory(access)
+add_subdirectory(kernel)
+add_subdirectory(socket)
+if(QT_FEATURE_openssl)
+ add_subdirectory(ssl)
+endif()
diff --git a/tests/benchmarks/network/access/CMakeLists.txt b/tests/benchmarks/network/access/CMakeLists.txt
new file mode 100644
index 0000000000..58f72cd248
--- /dev/null
+++ b/tests/benchmarks/network/access/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Generated from access.pro.
+
+add_subdirectory(qfile_vs_qnetworkaccessmanager)
+add_subdirectory(qnetworkreply)
+add_subdirectory(qnetworkreply_from_cache)
+add_subdirectory(qnetworkdiskcache)
diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/CMakeLists.txt b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/CMakeLists.txt
new file mode 100644
index 0000000000..abfb0206d3
--- /dev/null
+++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Generated from qfile_vs_qnetworkaccessmanager.pro.
+
+#####################################################################
+## tst_bench_qfile_vs_qnetworkaccessmanager Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qfile_vs_qnetworkaccessmanager
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Network
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qfile_vs_qnetworkaccessmanager.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
index 46bb1791b4..1f3f38eaaf 100644
--- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
+++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
@@ -105,7 +105,7 @@ void qfile_vs_qnetworkaccessmanager::qnamFileRead()
}
qint64 elapsed = t.elapsed();
- qDebug() << endl << "Finished!";
+ qDebug() << Qt::endl << "Finished!";
qDebug() << "Bytes:" << size;
qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
}
@@ -138,7 +138,7 @@ void qfile_vs_qnetworkaccessmanager::qnamImmediateFileRead()
}
qint64 elapsed = t.elapsed();
- qDebug() << endl << "Finished!";
+ qDebug() << Qt::endl << "Finished!";
qDebug() << "Bytes:" << size;
qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
}
@@ -167,7 +167,7 @@ void qfile_vs_qnetworkaccessmanager::qfileFileRead()
}
qint64 elapsed = t.elapsed();
- qDebug() << endl << "Finished!";
+ qDebug() << Qt::endl << "Finished!";
qDebug() << "Bytes:" << size;
qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
}
diff --git a/tests/benchmarks/network/access/qnetworkdiskcache/CMakeLists.txt b/tests/benchmarks/network/access/qnetworkdiskcache/CMakeLists.txt
new file mode 100644
index 0000000000..d70d2756a9
--- /dev/null
+++ b/tests/benchmarks/network/access/qnetworkdiskcache/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Generated from qnetworkdiskcache.pro.
+
+#####################################################################
+## tst_bench_qnetworkdiskcache Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qnetworkdiskcache
+ SOURCES
+ tst_qnetworkdiskcache.cpp
+ PUBLIC_LIBRARIES
+ Qt::Network
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qnetworkdiskcache.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/access/qnetworkreply/CMakeLists.txt b/tests/benchmarks/network/access/qnetworkreply/CMakeLists.txt
new file mode 100644
index 0000000000..c77f7b56f8
--- /dev/null
+++ b/tests/benchmarks/network/access/qnetworkreply/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Generated from qnetworkreply.pro.
+
+#####################################################################
+## tst_bench_qnetworkreply Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qnetworkreply
+ SOURCES
+ tst_qnetworkreply.cpp
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Network
+ Qt::NetworkPrivate
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qnetworkreply.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
index bcd354ebee..95ee094f00 100644
--- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -545,15 +545,10 @@ void tst_qnetworkreply::echoPerformance()
void tst_qnetworkreply::preConnectEncrypted()
{
QFETCH(int, sleepTime);
- QFETCH(QSslConfiguration, sslConfiguration);
- bool spdyEnabled = !sslConfiguration.isNull();
-
QString hostName = QLatin1String("www.google.com");
QNetworkAccessManager manager;
QNetworkRequest request(QUrl("https://" + hostName));
- if (spdyEnabled)
- request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true);
// make sure we have a full request including
// DNS lookup, TCP and SSL handshakes
@@ -579,12 +574,7 @@ void tst_qnetworkreply::preConnectEncrypted()
manager.clearAccessCache();
// now try to make the connection beforehand
- if (spdyEnabled) {
- request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true);
- manager.connectToHostEncrypted(hostName, 443, sslConfiguration);
- } else {
- manager.connectToHostEncrypted(hostName);
- }
+ manager.connectToHostEncrypted(hostName);
QTestEventLoop::instance().enterLoopMSecs(sleepTime);
// now make another request and hopefully use the existing connection
@@ -592,8 +582,6 @@ void tst_qnetworkreply::preConnectEncrypted()
QNetworkReply *preConnectReply = normalResult.first;
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(preConnectReply->error() == QNetworkReply::NoError);
- bool spdyWasUsed = preConnectReply->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool();
- QCOMPARE(spdyEnabled, spdyWasUsed);
qint64 preConnectElapsed = preConnectResult.second;
qDebug() << request.url().toString() << "full request:" << normalElapsed
<< "ms, pre-connect request:" << preConnectElapsed << "ms, difference:"
@@ -606,27 +594,11 @@ void tst_qnetworkreply::preConnectEncrypted_data()
{
#ifndef QT_NO_OPENSSL
QTest::addColumn<int>("sleepTime");
- QTest::addColumn<QSslConfiguration>("sslConfiguration");
-
// start a new normal request after preconnecting is done
- QTest::newRow("HTTPS-2secs") << 2000 << QSslConfiguration();
+ QTest::newRow("HTTPS-2secs") << 2000;
// start a new normal request while preconnecting is in-flight
- QTest::newRow("HTTPS-100ms") << 100 << QSslConfiguration();
-
- QSslConfiguration spdySslConf = QSslConfiguration::defaultConfiguration();
- QList<QByteArray> nextProtocols = QList<QByteArray>()
- << QSslConfiguration::NextProtocolSpdy3_0
- << QSslConfiguration::NextProtocolHttp1_1;
- spdySslConf.setAllowedNextProtocols(nextProtocols);
-
-#if defined(QT_BUILD_INTERNAL) && !defined(QT_NO_SSL) && OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
- // start a new SPDY request while preconnecting is done
- QTest::newRow("SPDY-2secs") << 2000 << spdySslConf;
-
- // start a new SPDY request while preconnecting is in-flight
- QTest::newRow("SPDY-100ms") << 100 << spdySslConf;
-#endif // defined (QT_BUILD_INTERNAL) && !defined(QT_NO_SSL) ...
+ QTest::newRow("HTTPS-100ms") << 100;
#endif // QT_NO_OPENSSL
}
diff --git a/tests/benchmarks/network/access/qnetworkreply_from_cache/CMakeLists.txt b/tests/benchmarks/network/access/qnetworkreply_from_cache/CMakeLists.txt
new file mode 100644
index 0000000000..57cfebb1ff
--- /dev/null
+++ b/tests/benchmarks/network/access/qnetworkreply_from_cache/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Generated from qnetworkreply_from_cache.pro.
+
+#####################################################################
+## tst_bench_qnetworkreply_from_cache Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qnetworkreply_from_cache
+ SOURCES
+ tst_qnetworkreply_from_cache.cpp
+ PUBLIC_LIBRARIES
+ Qt::Network
+ Qt::Test
+)
diff --git a/tests/benchmarks/network/kernel/CMakeLists.txt b/tests/benchmarks/network/kernel/CMakeLists.txt
new file mode 100644
index 0000000000..13a7caecdb
--- /dev/null
+++ b/tests/benchmarks/network/kernel/CMakeLists.txt
@@ -0,0 +1,5 @@
+# Generated from kernel.pro.
+
+if(QT_FEATURE_private_tests)
+ add_subdirectory(qhostinfo)
+endif()
diff --git a/tests/benchmarks/network/kernel/qhostinfo/CMakeLists.txt b/tests/benchmarks/network/kernel/qhostinfo/CMakeLists.txt
new file mode 100644
index 0000000000..f234b5d7a4
--- /dev/null
+++ b/tests/benchmarks/network/kernel/qhostinfo/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Generated from qhostinfo.pro.
+
+#####################################################################
+## tst_bench_qhostinfo Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qhostinfo
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Network
+ Qt::NetworkPrivate
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qhostinfo.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/socket/CMakeLists.txt b/tests/benchmarks/network/socket/CMakeLists.txt
new file mode 100644
index 0000000000..6d54bc05f5
--- /dev/null
+++ b/tests/benchmarks/network/socket/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from socket.pro.
+
+add_subdirectory(qtcpserver)
+add_subdirectory(qudpsocket)
diff --git a/tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt b/tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt
new file mode 100644
index 0000000000..7e1eab88a9
--- /dev/null
+++ b/tests/benchmarks/network/socket/qtcpserver/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Generated from qtcpserver.pro.
+
+#####################################################################
+## tst_bench_qtcpserver Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qtcpserver
+ SOURCES
+ tst_qtcpserver.cpp
+ PUBLIC_LIBRARIES
+ Qt::Network
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qtcpserver.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt b/tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt
new file mode 100644
index 0000000000..58b4ab17d4
--- /dev/null
+++ b/tests/benchmarks/network/socket/qudpsocket/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Generated from qudpsocket.pro.
+
+#####################################################################
+## tst_bench_qudpsocket Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qudpsocket
+ SOURCES
+ tst_qudpsocket.cpp
+ PUBLIC_LIBRARIES
+ Qt::Network
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qudpsocket.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/network/ssl/CMakeLists.txt b/tests/benchmarks/network/ssl/CMakeLists.txt
new file mode 100644
index 0000000000..bc469359f1
--- /dev/null
+++ b/tests/benchmarks/network/ssl/CMakeLists.txt
@@ -0,0 +1,3 @@
+# Generated from ssl.pro.
+
+add_subdirectory(qsslsocket)
diff --git a/tests/benchmarks/network/ssl/qsslsocket/CMakeLists.txt b/tests/benchmarks/network/ssl/qsslsocket/CMakeLists.txt
new file mode 100644
index 0000000000..7a127b071d
--- /dev/null
+++ b/tests/benchmarks/network/ssl/qsslsocket/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Generated from qsslsocket.pro.
+
+#####################################################################
+## tst_bench_qsslsocket Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qsslsocket
+ SOURCES
+ tst_qsslsocket.cpp
+ PUBLIC_LIBRARIES
+ Qt::Network
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qsslsocket.pro:<TRUE>:
+# TEMPLATE = "app"