summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/io
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib/io')
-rw-r--r--tests/benchmarks/corelib/io/CMakeLists.txt12
-rw-r--r--tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt15
-rw-r--r--tests/benchmarks/corelib/io/qdir/CMakeLists.txt3
-rw-r--r--tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt2
-rw-r--r--tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt28
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt21
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/main.cpp31
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro7
-rw-r--r--tests/benchmarks/corelib/io/qfile/CMakeLists.txt24
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt16
-rw-r--r--tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt15
-rw-r--r--tests/benchmarks/corelib/io/qprocess/CMakeLists.txt4
-rw-r--r--tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt13
-rw-r--r--tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt21
-rw-r--r--tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt15
-rw-r--r--tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt15
-rw-r--r--tests/benchmarks/corelib/io/qurl/CMakeLists.txt23
17 files changed, 262 insertions, 3 deletions
diff --git a/tests/benchmarks/corelib/io/CMakeLists.txt b/tests/benchmarks/corelib/io/CMakeLists.txt
new file mode 100644
index 0000000000..3419c4a28c
--- /dev/null
+++ b/tests/benchmarks/corelib/io/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Generated from io.pro.
+
+add_subdirectory(qdir)
+add_subdirectory(qdiriterator)
+add_subdirectory(qfile)
+add_subdirectory(qfileinfo)
+add_subdirectory(qiodevice)
+add_subdirectory(qtemporaryfile)
+add_subdirectory(qtextstream)
+if(QT_FEATURE_process)
+ add_subdirectory(qprocess)
+endif()
diff --git a/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt
new file mode 100644
index 0000000000..51f603b595
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Generated from 10000.pro.
+
+#####################################################################
+## tst_bench_qdir_10000 Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qdir_10000
+ SOURCES
+ bench_qdir_10000.cpp
+ PUBLIC_LIBRARIES
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:10000.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/corelib/io/qdir/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt
new file mode 100644
index 0000000000..10185014fa
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt
@@ -0,0 +1,3 @@
+# Generated from qdir.pro.
+
+add_subdirectory(10000)
diff --git a/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt b/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt
index b915320e9e..707a597361 100644
--- a/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt
+++ b/tests/benchmarks/corelib/io/qdir/tree/4.6.0-list.txt
@@ -8150,8 +8150,6 @@
qdatetime_p.h
qeasingcurve.cpp
qeasingcurve.h
- qharfbuzz.cpp
- qharfbuzz_p.h
qhash.cpp
qhash.h
qiterator.h
diff --git a/tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt
new file mode 100644
index 0000000000..e3102a3389
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Generated from tree.pro.
+
+#####################################################################
+## bench_qdir_tree Binary:
+#####################################################################
+
+add_qt_benchmark(bench_qdir_tree
+ SOURCES
+ bench_qdir_tree.cpp
+ PUBLIC_LIBRARIES
+ Qt::Test
+)
+
+# Resources:
+set(bench_qdir_tree_resource_files
+ "4.6.0-list.txt"
+)
+
+add_qt_resource(bench_qdir_tree "bench_qdir_tree"
+ PREFIX
+ "/"
+ FILES
+ ${bench_qdir_tree_resource_files}
+)
+
+
+#### Keys ignored in scope 1:.:.:tree.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt b/tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt
new file mode 100644
index 0000000000..b1e86861b6
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Generated from qdiriterator.pro.
+
+#####################################################################
+## tst_bench_qdiriterator Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qdiriterator
+ SOURCES
+ main.cpp
+ qfilesystemiterator.cpp qfilesystemiterator.h
+ PUBLIC_LIBRARIES
+ Qt::Test
+)
+
+## Scopes:
+#####################################################################
+
+extend_target(tst_bench_qdiriterator CONDITION (QT_FEATURE_cxx17_filesystem) AND (GCC AND (QMAKE_GCC_MAJOR_VERSION LESS 9))
+ LINK_OPTIONS
+ "-lstdc++fs"
+)
diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
index eae752d99a..5b10a4a689 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
@@ -44,9 +44,15 @@
#include "qfilesystemiterator.h"
+#if QT_CONFIG(cxx17_filesystem)
+#include <filesystem>
+#endif
+
class tst_qdiriterator : public QObject
{
Q_OBJECT
+
+ void data();
private slots:
void posix();
void posix_data() { data(); }
@@ -54,7 +60,8 @@ private slots:
void diriterator_data() { data(); }
void fsiterator();
void fsiterator_data() { data(); }
- void data();
+ void stdRecursiveDirectoryIterator();
+ void stdRecursiveDirectoryIterator_data() { data(); }
};
@@ -235,6 +242,28 @@ void tst_qdiriterator::fsiterator()
qDebug() << count;
}
+void tst_qdiriterator::stdRecursiveDirectoryIterator()
+{
+#if QT_CONFIG(cxx17_filesystem)
+ QFETCH(QByteArray, dirpath);
+
+ int count = 0;
+
+ QBENCHMARK {
+ int c = 0;
+ for (auto obj : std::filesystem::recursive_directory_iterator(dirpath.data())) {
+ if (obj.is_directory())
+ continue;
+ c++;
+ }
+ count = c;
+ }
+ qDebug() << count;
+#else
+ QSKIP("Not supported.");
+#endif
+}
+
QTEST_MAIN(tst_qdiriterator)
#include "main.moc"
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
index b332cda84b..0921b8424e 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
@@ -1,6 +1,13 @@
CONFIG += benchmark
QT = core testlib
+# Enable c++17 support for std::filesystem
+qtConfig(cxx17_filesystem) {
+ CONFIG += c++17
+ gcc:lessThan(QMAKE_GCC_MAJOR_VERSION, 9): \
+ QMAKE_LFLAGS += -lstdc++fs
+}
+
TARGET = tst_bench_qdiriterator
SOURCES += main.cpp qfilesystemiterator.cpp
HEADERS += qfilesystemiterator.h
diff --git a/tests/benchmarks/corelib/io/qfile/CMakeLists.txt b/tests/benchmarks/corelib/io/qfile/CMakeLists.txt
new file mode 100644
index 0000000000..7d1e19d75a
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qfile/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Generated from qfile.pro.
+
+#####################################################################
+## tst_bench_qfile Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qfile
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qfile.pro:<TRUE>:
+# TEMPLATE = "app"
+
+## Scopes:
+#####################################################################
+
+extend_target(tst_bench_qfile CONDITION WIN32
+ DEFINES
+ _CRT_SECURE_NO_WARNINGS
+)
diff --git a/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt b/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt
new file mode 100644
index 0000000000..195419f52e
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt
@@ -0,0 +1,16 @@
+# Generated from qfileinfo.pro.
+
+#####################################################################
+## tst_bench_qfileinfo Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qfileinfo
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qfileinfo.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt b/tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt
new file mode 100644
index 0000000000..7663bdb99d
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Generated from qiodevice.pro.
+
+#####################################################################
+## tst_bench_qiodevice Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qiodevice
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qiodevice.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/corelib/io/qprocess/CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/CMakeLists.txt
new file mode 100644
index 0000000000..d599539142
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qprocess/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from qprocess.pro.
+
+add_subdirectory(testProcessLoopback)
+add_subdirectory(test)
diff --git a/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt
new file mode 100644
index 0000000000..00bbe74c2d
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Generated from test.pro.
+
+#####################################################################
+## tst_bench_qprocess Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qprocess
+ SOURCES
+ ../tst_bench_qprocess.cpp
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Test
+)
diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt
new file mode 100644
index 0000000000..44b18a4826
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Generated from testProcessLoopback.pro.
+
+#####################################################################
+## testProcessLoopback Binary:
+#####################################################################
+
+add_qt_benchmark(testProcessLoopback
+ OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Gui
+)
+
+## Scopes:
+#####################################################################
+
+extend_target(testProcessLoopback CONDITION WINRT
+ LINK_OPTIONS
+ "/ENTRY:mainCRTStartup"
+)
diff --git a/tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt b/tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt
new file mode 100644
index 0000000000..82b885bb17
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Generated from qtemporaryfile.pro.
+
+#####################################################################
+## tst_bench_qtemporaryfile Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qtemporaryfile
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qtemporaryfile.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt b/tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt
new file mode 100644
index 0000000000..6dd11f1bbb
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Generated from qtextstream.pro.
+
+#####################################################################
+## tst_bench_qtextstream Binary:
+#####################################################################
+
+add_qt_benchmark(tst_bench_qtextstream
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qtextstream.pro:<TRUE>:
+# TEMPLATE = "app"
diff --git a/tests/benchmarks/corelib/io/qurl/CMakeLists.txt b/tests/benchmarks/corelib/io/qurl/CMakeLists.txt
new file mode 100644
index 0000000000..26d98b7eb4
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qurl/CMakeLists.txt
@@ -0,0 +1,23 @@
+# Generated from qurl.pro.
+
+#####################################################################
+## tst_qurl Binary:
+#####################################################################
+
+add_qt_benchmark(tst_qurl
+ SOURCES
+ main.cpp
+ PUBLIC_LIBRARIES
+ Qt::Test
+)
+
+#### Keys ignored in scope 1:.:.:qurl.pro:<TRUE>:
+# TEMPLATE = "app"
+
+## Scopes:
+#####################################################################
+
+extend_target(tst_qurl CONDITION WIN32
+ DEFINES
+ _CRT_SECURE_NO_WARNINGS
+)