summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/corelib/CMakeLists.txt4
-rw-r--r--tests/benchmarks/corelib/io/qdir/CMakeLists.txt2
-rw-r--r--tests/benchmarks/corelib/itemmodels/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/thread/CMakeLists.txt4
-rw-r--r--tests/benchmarks/gui/text/qtext/main.cpp8
-rw-r--r--tests/benchmarks/network/access/CMakeLists.txt6
-rw-r--r--tests/benchmarks/network/access/qdecompresshelper/main.cpp3
-rw-r--r--tests/benchmarks/network/socket/CMakeLists.txt10
8 files changed, 36 insertions, 8 deletions
diff --git a/tests/benchmarks/corelib/CMakeLists.txt b/tests/benchmarks/corelib/CMakeLists.txt
index 855e7ee2fa..890cbcfc6b 100644
--- a/tests/benchmarks/corelib/CMakeLists.txt
+++ b/tests/benchmarks/corelib/CMakeLists.txt
@@ -4,7 +4,9 @@
add_subdirectory(io)
add_subdirectory(itemmodels)
add_subdirectory(json)
-add_subdirectory(mimetypes)
+if(QT_FEATURE_mimetype)
+ add_subdirectory(mimetypes)
+endif()
add_subdirectory(kernel)
add_subdirectory(text)
add_subdirectory(thread)
diff --git a/tests/benchmarks/corelib/io/qdir/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt
index f1800fc0cd..00991de9a9 100644
--- a/tests/benchmarks/corelib/io/qdir/CMakeLists.txt
+++ b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt
@@ -1,2 +1,4 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(10000)
add_subdirectory(tree)
diff --git a/tests/benchmarks/corelib/itemmodels/CMakeLists.txt b/tests/benchmarks/corelib/itemmodels/CMakeLists.txt
index c74f36709c..8dc331aee2 100644
--- a/tests/benchmarks/corelib/itemmodels/CMakeLists.txt
+++ b/tests/benchmarks/corelib/itemmodels/CMakeLists.txt
@@ -1 +1,6 @@
-add_subdirectory(qsortfilterproxymodel)
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(QT_FEATURE_proxymodel)
+ add_subdirectory(qsortfilterproxymodel)
+endif()
diff --git a/tests/benchmarks/corelib/thread/CMakeLists.txt b/tests/benchmarks/corelib/thread/CMakeLists.txt
index 48bf0572a6..fd7cbe6117 100644
--- a/tests/benchmarks/corelib/thread/CMakeLists.txt
+++ b/tests/benchmarks/corelib/thread/CMakeLists.txt
@@ -1,7 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-add_subdirectory(qfuture)
+if(QT_FEATURE_future)
+ add_subdirectory(qfuture)
+endif()
add_subdirectory(qmutex)
add_subdirectory(qreadwritelock)
add_subdirectory(qthreadstorage)
diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp
index 121bc43573..9a2740253c 100644
--- a/tests/benchmarks/gui/text/qtext/main.cpp
+++ b/tests/benchmarks/gui/text/qtext/main.cpp
@@ -25,7 +25,9 @@ public:
private slots:
void loadHtml_data();
+#ifndef QT_NO_TEXTHTMLPARSER
void loadHtml();
+#endif
void shaping_data();
void shaping();
@@ -47,9 +49,11 @@ private slots:
void paintLayoutToPixmap();
void paintLayoutToPixmap_painterFill();
+#ifndef QT_NO_TEXTHTMLPARSER
void document();
void paintDocToPixmap();
void paintDocToPixmap_painterFill();
+#endif
private:
QSize setupTextLayout(QTextLayout *layout, bool wrap = true, int wrapWidth = 100);
@@ -76,6 +80,7 @@ void tst_QText::loadHtml_data()
+ parag;
}
+#ifndef QT_NO_TEXTHTMLPARSER
void tst_QText::loadHtml()
{
QFETCH(QString, source);
@@ -84,6 +89,7 @@ void tst_QText::loadHtml()
doc.setHtml(source);
}
}
+#endif
void tst_QText::shaping_data()
{
@@ -371,6 +377,7 @@ void tst_QText::paintLayoutToPixmap_painterFill()
}
}
+#ifndef QT_NO_TEXTHTMLPARSER
void tst_QText::document()
{
QTextDocument *doc = new QTextDocument;
@@ -413,6 +420,7 @@ void tst_QText::paintDocToPixmap_painterFill()
doc->drawContents(&p);
}
}
+#endif
QTEST_MAIN(tst_QText)
diff --git a/tests/benchmarks/network/access/CMakeLists.txt b/tests/benchmarks/network/access/CMakeLists.txt
index bc085cad61..bc5148af55 100644
--- a/tests/benchmarks/network/access/CMakeLists.txt
+++ b/tests/benchmarks/network/access/CMakeLists.txt
@@ -4,8 +4,10 @@
add_subdirectory(qfile_vs_qnetworkaccessmanager)
add_subdirectory(qhttpheaders)
add_subdirectory(qnetworkreply)
-add_subdirectory(qnetworkreply_from_cache)
-add_subdirectory(qnetworkdiskcache)
+if(QT_FEATURE_networkdiskcache)
+ add_subdirectory(qnetworkreply_from_cache)
+ add_subdirectory(qnetworkdiskcache)
+endif()
if(QT_FEATURE_private_tests)
add_subdirectory(qdecompresshelper)
endif()
diff --git a/tests/benchmarks/network/access/qdecompresshelper/main.cpp b/tests/benchmarks/network/access/qdecompresshelper/main.cpp
index 09c24af668..7f8b09ef0e 100644
--- a/tests/benchmarks/network/access/qdecompresshelper/main.cpp
+++ b/tests/benchmarks/network/access/qdecompresshelper/main.cpp
@@ -51,13 +51,14 @@ void tst_QDecompressHelper::decompress()
file.seek(0);
QDecompressHelper helper;
helper.setEncoding(encoding);
+ helper.setDecompressedSafetyCheckThreshold(-1);
QVERIFY(helper.isValid());
helper.feed(file.readAll());
qsizetype bytes = 0;
+ QByteArray out(64 * 1024, Qt::Uninitialized);
while (helper.hasData()) {
- QByteArray out(64 * 1024, Qt::Uninitialized);
qsizetype bytesRead = helper.read(out.data(), out.size());
bytes += bytesRead;
}
diff --git a/tests/benchmarks/network/socket/CMakeLists.txt b/tests/benchmarks/network/socket/CMakeLists.txt
index 034f618737..411a933dbb 100644
--- a/tests/benchmarks/network/socket/CMakeLists.txt
+++ b/tests/benchmarks/network/socket/CMakeLists.txt
@@ -1,6 +1,12 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-add_subdirectory(qlocalsocket)
+if(QT_FEATURE_localserver)
+ add_subdirectory(qlocalsocket)
+endif()
+
+if(QT_FEATURE_udpsocket)
+ add_subdirectory(qudpsocket)
+endif()
+
add_subdirectory(qtcpserver)
-add_subdirectory(qudpsocket)