diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-18 11:48:29 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-30 19:21:08 +0200 |
commit | 9004a2412ba1f9976c2c61f01223dff852208c42 (patch) | |
tree | f06abeec8b9cc66abf0e66cc9048c7a0ed02a360 /tests/benchmarks/corelib | |
parent | c2a6749af795386495b275684418d083410fa1e4 (diff) |
Diffstat (limited to 'tests/benchmarks/corelib')
95 files changed, 359 insertions, 524 deletions
diff --git a/tests/benchmarks/corelib/io/CMakeLists.txt b/tests/benchmarks/corelib/io/CMakeLists.txt index 3419c4a28c..8d4b556abc 100644 --- a/tests/benchmarks/corelib/io/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/CMakeLists.txt @@ -1,12 +1,11 @@ -# 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() +add_subdirectory(qtemporaryfile) +add_subdirectory(qtextstream) +add_subdirectory(qurl) diff --git a/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt index e83c4e9acc..d1feaa5f18 100644 --- a/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from 10000.pro. - ##################################################################### ## tst_bench_qdir_10000 Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qdir_10000 SOURCES - bench_qdir_10000.cpp + tst_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/10000/bench_qdir_10000.cpp b/tests/benchmarks/corelib/io/qdir/10000/tst_bench_qdir_10000.cpp index e02cfb3099..4ed1246a6c 100644 --- a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp +++ b/tests/benchmarks/corelib/io/qdir/10000/tst_bench_qdir_10000.cpp @@ -38,10 +38,12 @@ # include <unistd.h> #endif -class bench_QDir_10000 : public QObject{ - Q_OBJECT +class tst_QDir_10000 : public QObject +{ + Q_OBJECT public slots: - void initTestCase() { + void initTestCase() + { QDir testdir = QDir::tempPath(); const QString subfolder_name = QLatin1String("test_speed"); @@ -53,7 +55,8 @@ public slots: file.open(QIODevice::WriteOnly); } } - void cleanupTestCase() { + void cleanupTestCase() + { { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); testdir.setSorting(QDir::Unsorted); @@ -68,7 +71,8 @@ public slots: private slots: void baseline() {} - void sizeSpeed() { + void sizeSpeed() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QBENCHMARK { QFileInfoList fileInfoList = testdir.entryInfoList(QDir::Files, QDir::Unsorted); @@ -78,7 +82,8 @@ private slots: } } } - void sizeSpeedIterator() { + void sizeSpeedIterator() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QBENCHMARK { QDirIterator dit(testdir.path(), QDir::Files); @@ -90,7 +95,8 @@ private slots: } } - void sizeSpeedWithoutFilter() { + void sizeSpeedWithoutFilter() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QBENCHMARK { QFileInfoList fileInfoList = testdir.entryInfoList(QDir::NoFilter, QDir::Unsorted); @@ -99,7 +105,8 @@ private slots: } } } - void sizeSpeedWithoutFilterIterator() { + void sizeSpeedWithoutFilterIterator() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QBENCHMARK { QDirIterator dit(testdir.path()); @@ -111,7 +118,8 @@ private slots: } } - void sizeSpeedWithoutFileInfoList() { + void sizeSpeedWithoutFileInfoList() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); testdir.setSorting(QDir::Unsorted); QBENCHMARK { @@ -123,7 +131,8 @@ private slots: } } - void iDontWantAnyStat() { + void iDontWantAnyStat() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); testdir.setSorting(QDir::Unsorted); testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden); @@ -134,7 +143,8 @@ private slots: } } } - void iDontWantAnyStatIterator() { + void iDontWantAnyStatIterator() + { QBENCHMARK { QDirIterator dit(QDir::tempPath() + QLatin1String("/test_speed")); while (dit.hasNext()) { @@ -143,7 +153,8 @@ private slots: } } - void sorted_byTime() { + void sorted_byTime() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); testdir.setSorting(QDir::Time); testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden); @@ -155,7 +166,8 @@ private slots: } } - void sizeSpeedWithoutFilterLowLevel() { + void sizeSpeedWithoutFilterLowLevel() + { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); #ifdef Q_OS_WIN const wchar_t *dirpath = (wchar_t*)testdir.absolutePath().utf16(); @@ -194,5 +206,6 @@ private slots: } }; -QTEST_MAIN(bench_QDir_10000) -#include "bench_qdir_10000.moc" +QTEST_MAIN(tst_QDir_10000) + +#include "tst_bench_qdir_10000.moc" diff --git a/tests/benchmarks/corelib/io/qdir/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt index 10185014fa..f1800fc0cd 100644 --- a/tests/benchmarks/corelib/io/qdir/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qdir/CMakeLists.txt @@ -1,3 +1,2 @@ -# Generated from qdir.pro. - add_subdirectory(10000) +add_subdirectory(tree) diff --git a/tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt index c60bfcfdc3..32dea04edc 100644 --- a/tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qdir/tree/CMakeLists.txt @@ -1,28 +1,22 @@ -# Generated from tree.pro. - ##################################################################### -## bench_qdir_tree Binary: +## tst_bench_qdir_tree Binary: ##################################################################### -qt_internal_add_benchmark(bench_qdir_tree +qt_internal_add_benchmark(tst_bench_qdir_tree SOURCES - bench_qdir_tree.cpp + tst_bench_qdir_tree.cpp PUBLIC_LIBRARIES Qt::Test ) # Resources: -set(bench_qdir_tree_resource_files +set(qdir_tree_resource_files "4.6.0-list.txt" ) -qt_internal_add_resource(bench_qdir_tree "bench_qdir_tree" +qt_internal_add_resource(tst_bench_qdir_tree "tst_bench_qdir_tree" PREFIX "/" FILES - ${bench_qdir_tree_resource_files} + ${qdir_tree_resource_files} ) - - -#### Keys ignored in scope 1:.:.:tree.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp b/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.cpp index df16a7978a..d960cb41e2 100644 --- a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp +++ b/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.cpp @@ -35,13 +35,13 @@ #include "../../../../../shared/filesystem.h" -class bench_QDir_tree +class tst_QDir_tree : public QObject { Q_OBJECT public: - bench_QDir_tree() + tst_QDir_tree() : prefix("test-tree/"), musicprefix(QLatin1String("music")), photoprefix(QLatin1String("photos")), @@ -221,5 +221,6 @@ private slots: } }; -QTEST_MAIN(bench_QDir_tree) -#include "bench_qdir_tree.moc" +QTEST_MAIN(tst_QDir_tree) + +#include "tst_bench_qdir_tree.moc" diff --git a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.qrc b/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.qrc index d57cb6c368..d57cb6c368 100644 --- a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.qrc +++ b/tests/benchmarks/corelib/io/qdir/tree/tst_bench_qdir_tree.qrc diff --git a/tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt b/tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt index 8ba331a113..f250a9627a 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qdiriterator/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qdiriterator.pro. - ##################################################################### ## tst_bench_qdiriterator Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qdiriterator SOURCES - main.cpp + tst_bench_qdiriterator.cpp qfilesystemiterator.cpp qfilesystemiterator.h PUBLIC_LIBRARIES Qt::Test diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/tst_bench_qdiriterator.cpp index acf1ede368..e22f235914 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/tst_bench_qdiriterator.cpp @@ -48,7 +48,7 @@ #include <filesystem> #endif -class tst_qdiriterator : public QObject +class tst_QDirIterator : public QObject { Q_OBJECT @@ -64,7 +64,7 @@ private slots: void stdRecursiveDirectoryIterator_data() { data(); } }; -void tst_qdiriterator::data() +void tst_QDirIterator::data() { const char hereRelative[] = "tests/benchmarks/corelib/io/qdiriterator"; QByteArray dir(QT_TESTCASE_SOURCEDIR); @@ -155,7 +155,7 @@ static int posix_helper(const char *dirpath) #endif -void tst_qdiriterator::posix() +void tst_QDirIterator::posix() { QFETCH(QByteArray, dirpath); @@ -173,7 +173,7 @@ void tst_qdiriterator::posix() qDebug() << count; } -void tst_qdiriterator::diriterator() +void tst_QDirIterator::diriterator() { QFETCH(QByteArray, dirpath); @@ -203,7 +203,7 @@ void tst_qdiriterator::diriterator() qDebug() << count; } -void tst_qdiriterator::fsiterator() +void tst_QDirIterator::fsiterator() { QFETCH(QByteArray, dirpath); @@ -235,7 +235,7 @@ void tst_qdiriterator::fsiterator() qDebug() << count; } -void tst_qdiriterator::stdRecursiveDirectoryIterator() +void tst_QDirIterator::stdRecursiveDirectoryIterator() { #if QT_CONFIG(cxx17_filesystem) QFETCH(QByteArray, dirpath); @@ -257,6 +257,6 @@ void tst_qdiriterator::stdRecursiveDirectoryIterator() #endif } -QTEST_MAIN(tst_qdiriterator) +QTEST_MAIN(tst_QDirIterator) -#include "main.moc" +#include "tst_bench_qdiriterator.moc" diff --git a/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt b/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt index 1c088bf71a..8933b30cf3 100644 --- a/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qfileinfo/CMakeLists.txt @@ -1,16 +1,11 @@ -# Generated from qfileinfo.pro. - ##################################################################### ## tst_bench_qfileinfo Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qfileinfo SOURCES - main.cpp + tst_bench_qfileinfo.cpp PUBLIC_LIBRARIES Qt::CorePrivate Qt::Test ) - -#### Keys ignored in scope 1:.:.:qfileinfo.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp index 2cd06eef27..21dbf47ba2 100644 --- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp +++ b/tests/benchmarks/corelib/io/qfileinfo/tst_bench_qfileinfo.cpp @@ -35,7 +35,7 @@ #include "private/qfsfileengine_p.h" #include "../../../../shared/filesystem.h" -class qfileinfo : public QObject +class tst_QFileInfo : public QObject { Q_OBJECT private slots: @@ -45,34 +45,22 @@ private slots: void symLinkTargetPerformanceLNK(); void junctionTargetPerformanceMountpoint(); #endif - void initTestCase(); - void cleanupTestCase(); -public: - qfileinfo() : QObject() {}; }; -void qfileinfo::initTestCase() -{ -} - -void qfileinfo::cleanupTestCase() -{ -} - -void qfileinfo::existsTemporary() +void tst_QFileInfo::existsTemporary() { QString appPath = QCoreApplication::applicationFilePath(); QBENCHMARK { QFileInfo(appPath).exists(); } } -void qfileinfo::existsStatic() +void tst_QFileInfo::existsStatic() { QString appPath = QCoreApplication::applicationFilePath(); QBENCHMARK { QFileInfo::exists(appPath); } } #if defined(Q_OS_WIN) -void qfileinfo::symLinkTargetPerformanceLNK() +void tst_QFileInfo::symLinkTargetPerformanceLNK() { QVERIFY(QFile::link("file","link.lnk")); QFileInfo info("link.lnk"); @@ -86,7 +74,7 @@ void qfileinfo::symLinkTargetPerformanceLNK() QVERIFY(QFile::remove("link.lnk")); } -void qfileinfo::junctionTargetPerformanceMountpoint() +void tst_QFileInfo::junctionTargetPerformanceMountpoint() { wchar_t buffer[MAX_PATH]; QString rootPath = QDir::toNativeSeparators(QDir::rootPath()); @@ -109,6 +97,6 @@ void qfileinfo::junctionTargetPerformanceMountpoint() } #endif -QTEST_MAIN(qfileinfo) +QTEST_MAIN(tst_QFileInfo) -#include "main.moc" +#include "tst_bench_qfileinfo.moc" diff --git a/tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt b/tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt index 3af6d4f214..ab8abc8788 100644 --- a/tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qiodevice/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qiodevice.pro. - ##################################################################### ## tst_bench_qiodevice Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qiodevice SOURCES - main.cpp + tst_bench_qiodevice.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qiodevice.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/io/qiodevice/main.cpp b/tests/benchmarks/corelib/io/qiodevice/tst_bench_qiodevice.cpp index de4660a253..47e616b409 100644 --- a/tests/benchmarks/corelib/io/qiodevice/main.cpp +++ b/tests/benchmarks/corelib/io/qiodevice/tst_bench_qiodevice.cpp @@ -32,8 +32,7 @@ #include <qtest.h> - -class tst_qiodevice : public QObject +class tst_QIODevice : public QObject { Q_OBJECT private slots: @@ -48,7 +47,7 @@ private: }; -void tst_qiodevice::read_data() +void tst_QIODevice::read_data() { QTest::addColumn<qint64>("size"); QTest::newRow("10k") << qint64(10 * 1024); @@ -59,7 +58,7 @@ void tst_qiodevice::read_data() QTest::newRow("1000000k") << qint64(1000000 * 1024); } -void tst_qiodevice::read_old() +void tst_QIODevice::read_old() { QFETCH(qint64, size); @@ -88,7 +87,7 @@ void tst_qiodevice::read_old() } } -void tst_qiodevice::peekAndRead() +void tst_QIODevice::peekAndRead() { QFETCH(qint64, size); @@ -119,6 +118,6 @@ void tst_qiodevice::peekAndRead() } } -QTEST_MAIN(tst_qiodevice) +QTEST_MAIN(tst_QIODevice) -#include "main.moc" +#include "tst_bench_qiodevice.moc" diff --git a/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt index ca7011a661..b08034e71d 100644 --- a/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from test.pro. - ##################################################################### ## tst_bench_qprocess Binary: ##################################################################### diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt index 896435b27b..a55a1e113a 100644 --- a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt @@ -2,4 +2,4 @@ ## testProcessLoopback Binary: ##################################################################### -add_executable(testProcessLoopback main.cpp) +add_executable(testProcessLoopback loopback.cpp) diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/main.cpp b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/loopback.cpp index 1773ba7496..1773ba7496 100644 --- a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/main.cpp +++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/loopback.cpp diff --git a/tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt b/tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt index a12bfd1260..5342cf8912 100644 --- a/tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qtemporaryfile/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qtemporaryfile.pro. - ##################################################################### ## tst_bench_qtemporaryfile Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qtemporaryfile SOURCES - main.cpp + tst_bench_qtemporaryfile.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qtemporaryfile.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/io/qtemporaryfile/main.cpp b/tests/benchmarks/corelib/io/qtemporaryfile/tst_bench_qtemporaryfile.cpp index c50032d174..fb855f1eda 100644 --- a/tests/benchmarks/corelib/io/qtemporaryfile/main.cpp +++ b/tests/benchmarks/corelib/io/qtemporaryfile/tst_bench_qtemporaryfile.cpp @@ -32,8 +32,7 @@ #include <QTemporaryFile> #include <qtest.h> - -class tst_qtemporaryfile : public QObject +class tst_QTemporaryFile : public QObject { Q_OBJECT private slots: @@ -45,7 +44,7 @@ private slots: private: }; -void tst_qtemporaryfile::openclose_data() +void tst_QTemporaryFile::openclose_data() { QTest::addColumn<qint64>("amount"); QTest::newRow("100") << qint64(100); @@ -53,7 +52,7 @@ void tst_qtemporaryfile::openclose_data() QTest::newRow("10000") << qint64(10000); } -void tst_qtemporaryfile::openclose() +void tst_QTemporaryFile::openclose() { QFETCH(qint64, amount); @@ -66,7 +65,7 @@ void tst_qtemporaryfile::openclose() } } -void tst_qtemporaryfile::readwrite() +void tst_QTemporaryFile::readwrite() { QFETCH(qint64, amount); @@ -85,6 +84,6 @@ void tst_qtemporaryfile::readwrite() } } -QTEST_MAIN(tst_qtemporaryfile) +QTEST_MAIN(tst_QTemporaryFile) -#include "main.moc" +#include "tst_bench_qtemporaryfile.moc" diff --git a/tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt b/tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt index 0393b91119..b54610ad74 100644 --- a/tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qtextstream/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qtextstream.pro. - ##################################################################### ## tst_bench_qtextstream Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qtextstream SOURCES - main.cpp + tst_bench_qtextstream.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qtextstream.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/io/qtextstream/main.cpp b/tests/benchmarks/corelib/io/qtextstream/tst_bench_qtextstream.cpp index 03dc3d1694..1da0d90c79 100644 --- a/tests/benchmarks/corelib/io/qtextstream/main.cpp +++ b/tests/benchmarks/corelib/io/qtextstream/tst_bench_qtextstream.cpp @@ -32,7 +32,7 @@ #include <QBuffer> #include <qtest.h> -class tst_qtextstream : public QObject +class tst_QTextStream : public QObject { Q_OBJECT private slots: @@ -48,7 +48,7 @@ Q_DECLARE_METATYPE(Output); enum Input { CharStarInput, QStringInput, CharInput, QCharInput }; Q_DECLARE_METATYPE(Input); -void tst_qtextstream::writeSingleChar_data() +void tst_QTextStream::writeSingleChar_data() { QTest::addColumn<Output>("output"); QTest::addColumn<Input>("input"); @@ -63,7 +63,7 @@ void tst_qtextstream::writeSingleChar_data() QTest::newRow("device_qchar") << DeviceOutput << QCharInput; } -void tst_qtextstream::writeSingleChar() +void tst_QTextStream::writeSingleChar() { QFETCH(Output, output); QFETCH(Input, input); @@ -115,6 +115,6 @@ void tst_qtextstream::writeSingleChar() QCOMPARE(result.left(10), QString("hhhhhhhhhh")); } -QTEST_MAIN(tst_qtextstream) +QTEST_MAIN(tst_QTextStream) -#include "main.moc" +#include "tst_bench_qtextstream.moc" diff --git a/tests/benchmarks/corelib/io/qurl/CMakeLists.txt b/tests/benchmarks/corelib/io/qurl/CMakeLists.txt index d38c8b18c0..e9c155ad3f 100644 --- a/tests/benchmarks/corelib/io/qurl/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qurl/CMakeLists.txt @@ -1,23 +1,18 @@ -# Generated from qurl.pro. - ##################################################################### ## tst_qurl Binary: ##################################################################### -qt_internal_add_benchmark(tst_qurl +qt_internal_add_benchmark(tst_bench_qurl SOURCES - main.cpp + tst_bench_qurl.cpp PUBLIC_LIBRARIES Qt::Test ) -#### Keys ignored in scope 1:.:.:qurl.pro:<TRUE>: -# TEMPLATE = "app" - ## Scopes: ##################################################################### -qt_internal_extend_target(tst_qurl CONDITION WIN32 +qt_internal_extend_target(tst_bench_qurl CONDITION WIN32 DEFINES _CRT_SECURE_NO_WARNINGS ) diff --git a/tests/benchmarks/corelib/io/qurl/main.cpp b/tests/benchmarks/corelib/io/qurl/tst_bench_qurl.cpp index 5ad3c3bd47..8165f8d059 100644 --- a/tests/benchmarks/corelib/io/qurl/main.cpp +++ b/tests/benchmarks/corelib/io/qurl/tst_bench_qurl.cpp @@ -29,7 +29,7 @@ #include <qurl.h> #include <qtest.h> -class tst_qurl: public QObject +class tst_QUrl : public QObject { Q_OBJECT @@ -53,28 +53,28 @@ private: void generateFirstRunData(); }; -void tst_qurl::emptyUrl() +void tst_QUrl::emptyUrl() { QBENCHMARK { QUrl url; } } -void tst_qurl::relativeUrl() +void tst_QUrl::relativeUrl() { QBENCHMARK { QUrl url("pics/avatar.png"); } } -void tst_qurl::absoluteUrl() +void tst_QUrl::absoluteUrl() { QBENCHMARK { QUrl url("/tmp/avatar.png"); } } -void tst_qurl::generateFirstRunData() +void tst_QUrl::generateFirstRunData() { QTest::addColumn<bool>("firstRun"); @@ -82,12 +82,12 @@ void tst_qurl::generateFirstRunData() QTest::newRow("subsequent runs") << false; } -void tst_qurl::isRelative_data() +void tst_QUrl::isRelative_data() { generateFirstRunData(); } -void tst_qurl::isRelative() +void tst_QUrl::isRelative() { QFETCH(bool, firstRun); if (firstRun) { @@ -103,12 +103,12 @@ void tst_qurl::isRelative() } } -void tst_qurl::toLocalFile_data() +void tst_QUrl::toLocalFile_data() { generateFirstRunData(); } -void tst_qurl::toLocalFile() +void tst_QUrl::toLocalFile() { QFETCH(bool, firstRun); if (firstRun) { @@ -124,12 +124,12 @@ void tst_qurl::toLocalFile() } } -void tst_qurl::toString_data() +void tst_QUrl::toString_data() { generateFirstRunData(); } -void tst_qurl::toString() +void tst_QUrl::toString() { QFETCH(bool, firstRun); if(firstRun) { @@ -145,35 +145,37 @@ void tst_qurl::toString() } } -void tst_qurl::resolved_data() +void tst_QUrl::resolved_data() { generateFirstRunData(); } -void tst_qurl::resolved() +void tst_QUrl::resolved() { QFETCH(bool, firstRun); - if(firstRun) { + QUrl expect("/home/user/pics/avatar.png"), actual; + if (firstRun) { QBENCHMARK { QUrl baseUrl("/home/user/"); QUrl url("pics/avatar.png"); - baseUrl.resolved(url); + actual = baseUrl.resolved(url); } } else { QUrl baseUrl("/home/user/"); QUrl url("pics/avatar.png"); QBENCHMARK { - baseUrl.resolved(url); + actual = baseUrl.resolved(url); } } + QCOMPARE(actual, expect); } -void tst_qurl::equality_data() +void tst_QUrl::equality_data() { generateFirstRunData(); } -void tst_qurl::equality() +void tst_QUrl::equality() { QFETCH(bool, firstRun); if(firstRun) { @@ -191,7 +193,7 @@ void tst_qurl::equality() } } -void tst_qurl::qmlPropertyWriteUseCase() +void tst_QUrl::qmlPropertyWriteUseCase() { QUrl base("file:///home/user/qt/examples/declarative/samegame/SamegameCore/"); QString str("pics/redStar.png"); @@ -203,6 +205,6 @@ void tst_qurl::qmlPropertyWriteUseCase() } } -QTEST_MAIN(tst_qurl) +QTEST_MAIN(tst_QUrl) -#include "main.moc" +#include "tst_bench_qurl.moc" diff --git a/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt b/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt index a18678159b..4ae255bbb4 100644 --- a/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt +++ b/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt @@ -1,6 +1,6 @@ qt_internal_add_benchmark(tst_bench_qsortfilterproxymodel SOURCES - tst_qsortfilterproxymodel.cpp + tst_bench_qsortfilterproxymodel.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_bench_qsortfilterproxymodel.cpp index f7fc0963bc..7c641a42ae 100644 --- a/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/benchmarks/corelib/itemmodels/qsortfilterproxymodel/tst_bench_qsortfilterproxymodel.cpp @@ -120,4 +120,4 @@ void tst_QSortFilterProxyModel::clearFilter() QTEST_MAIN(tst_QSortFilterProxyModel) -#include "tst_qsortfilterproxymodel.moc" +#include "tst_bench_qsortfilterproxymodel.moc" diff --git a/tests/benchmarks/corelib/kernel/events/CMakeLists.txt b/tests/benchmarks/corelib/kernel/events/CMakeLists.txt index 41add9350e..b5440891ee 100644 --- a/tests/benchmarks/corelib/kernel/events/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/events/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from events.pro. - ##################################################################### ## tst_bench_events Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_events SOURCES - main.cpp + tst_bench_events.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:events.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/kernel/events/main.cpp b/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp index 973d96261c..cfe5b1bcd1 100644 --- a/tests/benchmarks/corelib/kernel/events/main.cpp +++ b/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp @@ -171,4 +171,4 @@ void EventsBench::postEvent() QTEST_MAIN(EventsBench) -#include "main.moc" +#include "tst_bench_events.moc" diff --git a/tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt index 1618997909..0872bccf60 100644 --- a/tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qcoreapplication.pro. - ##################################################################### ## tst_bench_qcoreapplication Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qcoreapplication SOURCES - main.cpp + tst_bench_qcoreapplication.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qcoreapplication.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/kernel/qcoreapplication/main.cpp b/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp index 018f689785..86047a0b07 100644 --- a/tests/benchmarks/corelib/kernel/qcoreapplication/main.cpp +++ b/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp @@ -29,7 +29,7 @@ #include <qtest.h> #include <qcoreapplication.h> -class QCoreApplicationBenchmark : public QObject +class tst_QCoreApplication : public QObject { Q_OBJECT private slots: @@ -37,7 +37,7 @@ private slots: void event_posting_benchmark(); }; -void QCoreApplicationBenchmark::event_posting_benchmark_data() +void tst_QCoreApplication::event_posting_benchmark_data() { QTest::addColumn<int>("size"); QTest::newRow("50 events") << 50; @@ -49,7 +49,7 @@ void QCoreApplicationBenchmark::event_posting_benchmark_data() QTest::newRow("1000000 events") << 1000000; } -void QCoreApplicationBenchmark::event_posting_benchmark() +void tst_QCoreApplication::event_posting_benchmark() { QFETCH(int, size); @@ -64,6 +64,6 @@ void QCoreApplicationBenchmark::event_posting_benchmark() } } -QTEST_MAIN(QCoreApplicationBenchmark) +QTEST_MAIN(tst_QCoreApplication) -#include "main.moc" +#include "tst_bench_qcoreapplication.moc" diff --git a/tests/benchmarks/corelib/kernel/qmetaobject/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qmetaobject/CMakeLists.txt index db4c3ab12e..2afd390439 100644 --- a/tests/benchmarks/corelib/kernel/qmetaobject/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qmetaobject/CMakeLists.txt @@ -1,17 +1,12 @@ -# Generated from qmetaobject.pro. - ##################################################################### ## tst_bench_qmetaobject Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qmetaobject SOURCES - main.cpp + tst_bench_qmetaobject.cpp PUBLIC_LIBRARIES Qt::Gui Qt::Test Qt::Widgets ) - -#### Keys ignored in scope 1:.:.:qmetaobject.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/kernel/qmetaobject/main.cpp b/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp index 262dca7d52..7da721042b 100644 --- a/tests/benchmarks/corelib/kernel/qmetaobject/main.cpp +++ b/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp @@ -29,7 +29,7 @@ #include <QtWidgets/QTreeView> #include <qtest.h> -class LotsOfSignals : public QObject +class LotsOfSignals : public QObject // for the unconnected() test { Q_OBJECT public: @@ -107,13 +107,10 @@ signals: void extraSignal70(); }; -class tst_qmetaobject: public QObject +class tst_QMetaObject: public QObject { Q_OBJECT private slots: - void initTestCase(); - void cleanupTestCase(); - void indexOfProperty_data(); void indexOfProperty(); void indexOfMethod_data(); @@ -127,15 +124,7 @@ private slots: void unconnected(); }; -void tst_qmetaobject::initTestCase() -{ -} - -void tst_qmetaobject::cleanupTestCase() -{ -} - -void tst_qmetaobject::indexOfProperty_data() +void tst_QMetaObject::indexOfProperty_data() { QTest::addColumn<QByteArray>("name"); const QMetaObject *mo = &QTreeView::staticMetaObject; @@ -145,7 +134,7 @@ void tst_qmetaobject::indexOfProperty_data() } } -void tst_qmetaobject::indexOfProperty() +void tst_QMetaObject::indexOfProperty() { QFETCH(QByteArray, name); const char *p = name.constData(); @@ -155,7 +144,7 @@ void tst_qmetaobject::indexOfProperty() } } -void tst_qmetaobject::indexOfMethod_data() +void tst_QMetaObject::indexOfMethod_data() { QTest::addColumn<QByteArray>("method"); const QMetaObject *mo = &QTreeView::staticMetaObject; @@ -166,7 +155,7 @@ void tst_qmetaobject::indexOfMethod_data() } } -void tst_qmetaobject::indexOfMethod() +void tst_QMetaObject::indexOfMethod() { QFETCH(QByteArray, method); const char *p = method.constData(); @@ -176,7 +165,7 @@ void tst_qmetaobject::indexOfMethod() } } -void tst_qmetaobject::indexOfSignal_data() +void tst_QMetaObject::indexOfSignal_data() { QTest::addColumn<QByteArray>("signal"); const QMetaObject *mo = &QTreeView::staticMetaObject; @@ -189,7 +178,7 @@ void tst_qmetaobject::indexOfSignal_data() } } -void tst_qmetaobject::indexOfSignal() +void tst_QMetaObject::indexOfSignal() { QFETCH(QByteArray, signal); const char *p = signal.constData(); @@ -199,7 +188,7 @@ void tst_qmetaobject::indexOfSignal() } } -void tst_qmetaobject::indexOfSlot_data() +void tst_QMetaObject::indexOfSlot_data() { QTest::addColumn<QByteArray>("slot"); const QMetaObject *mo = &QTreeView::staticMetaObject; @@ -212,7 +201,7 @@ void tst_qmetaobject::indexOfSlot_data() } } -void tst_qmetaobject::indexOfSlot() +void tst_QMetaObject::indexOfSlot() { QFETCH(QByteArray, slot); const char *p = slot.constData(); @@ -222,7 +211,7 @@ void tst_qmetaobject::indexOfSlot() } } -void tst_qmetaobject::unconnected_data() +void tst_QMetaObject::unconnected_data() { QTest::addColumn<int>("signal_index"); QTest::newRow("signal--9") << 9; @@ -233,7 +222,7 @@ void tst_qmetaobject::unconnected_data() QTest::newRow("signal--70") << 70; } -void tst_qmetaobject::unconnected() +void tst_QMetaObject::unconnected() { LotsOfSignals *obj = new LotsOfSignals; QFETCH(int, signal_index); @@ -247,6 +236,6 @@ void tst_qmetaobject::unconnected() delete obj; } -QTEST_MAIN(tst_qmetaobject) +QTEST_MAIN(tst_QMetaObject) -#include "main.moc" +#include "tst_bench_qmetaobject.moc" diff --git a/tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt index ae4bc9c906..8fd20ee111 100644 --- a/tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qmetatype.pro. - ##################################################################### ## tst_bench_qmetatype Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qmetatype SOURCES - tst_qmetatype.cpp + tst_bench_qmetatype.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qmetatype.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp index d41823de71..c273cd32a4 100644 --- a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp @@ -321,4 +321,4 @@ void tst_QMetaType::constructInPlaceCopyStaticLess() } QTEST_MAIN(tst_QMetaType) -#include "tst_qmetatype.moc" +#include "tst_bench_qmetatype.moc" diff --git a/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt index ce834905b0..fb13e8a59e 100644 --- a/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt @@ -1,18 +1,13 @@ -# Generated from qobject.pro. - ##################################################################### ## tst_bench_qobject Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qobject SOURCES - main.cpp + tst_bench_qobject.cpp object.cpp object.h PUBLIC_LIBRARIES Qt::Gui Qt::Test Qt::Widgets ) - -#### Keys ignored in scope 1:.:.:qobject.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/kernel/qobject/main.cpp b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp index 918227f74e..0f57f2997a 100644 --- a/tests/benchmarks/corelib/kernel/qobject/main.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp @@ -37,7 +37,7 @@ enum { SignalsAndSlotsBenchmarkConstant = 456789 }; -class QObjectBenchmark : public QObject +class tst_QObject : public QObject { Q_OBJECT private slots: @@ -95,7 +95,7 @@ inline void allocator() } } -void QObjectBenchmark::stdAllocator() +void tst_QObject::stdAllocator() { allocator<QObjectUsingStandardAllocator>(); } @@ -104,7 +104,7 @@ struct Functor { void operator()(){} }; -void QObjectBenchmark::signal_slot_benchmark_data() +void tst_QObject::signal_slot_benchmark_data() { QTest::addColumn<int>("type"); QTest::newRow("simple function") << 0; @@ -115,7 +115,7 @@ void QObjectBenchmark::signal_slot_benchmark_data() QTest::newRow("functor") << 5; } -void QObjectBenchmark::signal_slot_benchmark() +void tst_QObject::signal_slot_benchmark() { QFETCH(int, type); @@ -176,7 +176,7 @@ void QObjectBenchmark::signal_slot_benchmark() } } -void QObjectBenchmark::signal_many_receivers_data() +void tst_QObject::signal_many_receivers_data() { QTest::addColumn<int>("receiverCount"); QTest::newRow("100 receivers") << 100; @@ -184,7 +184,7 @@ void QObjectBenchmark::signal_many_receivers_data() QTest::newRow("10 000 receivers") << 10000; } -void QObjectBenchmark::signal_many_receivers() +void tst_QObject::signal_many_receivers() { QFETCH(int, receiverCount); Object sender; @@ -198,7 +198,7 @@ void QObjectBenchmark::signal_many_receivers() } } -void QObjectBenchmark::qproperty_benchmark_data() +void tst_QObject::qproperty_benchmark_data() { QTest::addColumn<QByteArray>("name"); const QMetaObject *mo = &QTreeView::staticMetaObject; @@ -209,7 +209,7 @@ void QObjectBenchmark::qproperty_benchmark_data() } } -void QObjectBenchmark::qproperty_benchmark() +void tst_QObject::qproperty_benchmark() { QFETCH(QByteArray, name); const char *p = name.constData(); @@ -221,7 +221,7 @@ void QObjectBenchmark::qproperty_benchmark() } } -void QObjectBenchmark::dynamic_property_benchmark() +void tst_QObject::dynamic_property_benchmark() { QTreeView obj; QBENCHMARK { @@ -232,7 +232,7 @@ void QObjectBenchmark::dynamic_property_benchmark() } } -void QObjectBenchmark::connect_disconnect_benchmark_data() +void tst_QObject::connect_disconnect_benchmark_data() { QTest::addColumn<int>("type"); QTest::newRow("normalized signature") << 0; @@ -243,7 +243,7 @@ void QObjectBenchmark::connect_disconnect_benchmark_data() QTest::newRow("function pointer/handle") << 5; QTest::newRow("functor/handle") << 6;} -void QObjectBenchmark::connect_disconnect_benchmark() +void tst_QObject::connect_disconnect_benchmark() { QFETCH(int, type); switch (type) { @@ -296,7 +296,7 @@ void QObjectBenchmark::connect_disconnect_benchmark() } } -void QObjectBenchmark::receiver_destroyed_benchmark() +void tst_QObject::receiver_destroyed_benchmark() { Object sender; QBENCHMARK { @@ -305,6 +305,6 @@ void QObjectBenchmark::receiver_destroyed_benchmark() } } -QTEST_MAIN(QObjectBenchmark) +QTEST_MAIN(tst_QObject) -#include "main.moc" +#include "tst_bench_qobject.moc" diff --git a/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt index d6fc1c5a14..42345e6492 100644 --- a/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt @@ -1,6 +1,6 @@ qt_internal_add_benchmark(tst_bench_qproperty SOURCES - main.cpp + tst_bench_qproperty.cpp propertytester.h PUBLIC_LIBRARIES Qt::Core diff --git a/tests/benchmarks/corelib/kernel/qproperty/main.cpp b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp index 5d6db35d2b..ad62ad8075 100644 --- a/tests/benchmarks/corelib/kernel/qproperty/main.cpp +++ b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp @@ -33,7 +33,7 @@ #include "propertytester.h" -class PropertyBenchmark : public QObject +class tst_QProperty : public QObject { Q_OBJECT private slots: @@ -53,7 +53,7 @@ private slots: void cppNotifyingDirectReadOnce(); }; -void PropertyBenchmark::cppOldBinding() +void tst_QProperty::cppOldBinding() { QScopedPointer<PropertyTester> tester {new PropertyTester}; auto connection = connect(tester.data(), &PropertyTester::xOldChanged, @@ -70,7 +70,7 @@ void PropertyBenchmark::cppOldBinding() QObject::disconnect(connection); } -void PropertyBenchmark::cppOldBindingDirect() +void tst_QProperty::cppOldBindingDirect() { QScopedPointer<PropertyTester> tester {new PropertyTester}; auto connection = connect(tester.data(), &PropertyTester::xOldChanged, @@ -87,7 +87,7 @@ void PropertyBenchmark::cppOldBindingDirect() QObject::disconnect(connection); } -void PropertyBenchmark::cppOldBindingReadOnce() +void tst_QProperty::cppOldBindingReadOnce() { QScopedPointer<PropertyTester> tester {new PropertyTester}; auto connection = connect(tester.data(), &PropertyTester::xOldChanged, @@ -103,7 +103,7 @@ void PropertyBenchmark::cppOldBindingReadOnce() QObject::disconnect(connection); } -void PropertyBenchmark::cppOldBindingDirectReadOnce() +void tst_QProperty::cppOldBindingDirectReadOnce() { QScopedPointer<PropertyTester> tester {new PropertyTester}; auto connection = connect(tester.data(), &PropertyTester::xOldChanged, @@ -119,7 +119,7 @@ void PropertyBenchmark::cppOldBindingDirectReadOnce() QObject::disconnect(connection); } -void PropertyBenchmark::cppNewBinding() +void tst_QProperty::cppNewBinding() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->y.setBinding([&](){return tester->x.value();}); @@ -133,7 +133,7 @@ void PropertyBenchmark::cppNewBinding() } } -void PropertyBenchmark::cppNewBindingDirect() +void tst_QProperty::cppNewBindingDirect() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->y.setBinding([&](){return tester->x.value();}); @@ -146,7 +146,7 @@ void PropertyBenchmark::cppNewBindingDirect() } } -void PropertyBenchmark::cppNewBindingReadOnce() +void tst_QProperty::cppNewBindingReadOnce() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->y.setBinding([&](){return tester->x.value();}); @@ -160,7 +160,7 @@ void PropertyBenchmark::cppNewBindingReadOnce() QCOMPARE(tester->property("y").toInt(), i); } -void PropertyBenchmark::cppNewBindingDirectReadOnce() +void tst_QProperty::cppNewBindingDirectReadOnce() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->y.setBinding([&](){return tester->x.value();}); @@ -173,7 +173,7 @@ void PropertyBenchmark::cppNewBindingDirectReadOnce() QCOMPARE(tester->y.value(), i); } -void PropertyBenchmark::cppNotifying() +void tst_QProperty::cppNotifying() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->yNotified.setBinding([&](){return tester->xNotified.value();}); @@ -187,7 +187,7 @@ void PropertyBenchmark::cppNotifying() } } -void PropertyBenchmark::cppNotifyingDirect() +void tst_QProperty::cppNotifyingDirect() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->yNotified.setBinding([&](){return tester->xNotified.value();}); @@ -200,7 +200,7 @@ void PropertyBenchmark::cppNotifyingDirect() } } -void PropertyBenchmark::cppNotifyingReadOnce() +void tst_QProperty::cppNotifyingReadOnce() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->yNotified.setBinding([&](){return tester->xNotified.value();}); @@ -214,7 +214,7 @@ void PropertyBenchmark::cppNotifyingReadOnce() QCOMPARE(tester->property("yNotified").toInt(), i); } -void PropertyBenchmark::cppNotifyingDirectReadOnce() +void tst_QProperty::cppNotifyingDirectReadOnce() { QScopedPointer<PropertyTester> tester {new PropertyTester}; tester->yNotified.setBinding([&](){return tester->xNotified.value();}); @@ -227,5 +227,6 @@ void PropertyBenchmark::cppNotifyingDirectReadOnce() QCOMPARE(tester->yNotified.value(), i); } -QTEST_MAIN(PropertyBenchmark) -#include "main.moc" +QTEST_MAIN(tst_QProperty) + +#include "tst_bench_qproperty.moc" diff --git a/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt index 418fd1da9f..83e7269ff0 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qvariant.pro. - ##################################################################### ## tst_bench_qvariant Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qvariant SOURCES - tst_qvariant.cpp + tst_bench_qvariant.cpp PUBLIC_LIBRARIES Qt::Gui Qt::Test diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp index f2618f7813..1e35cf85f9 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp @@ -34,7 +34,7 @@ #define ITERATION_COUNT 1e5 -class tst_qvariant : public QObject +class tst_QVariant : public QObject { Q_OBJECT @@ -107,7 +107,7 @@ Q_DECLARE_TYPEINFO(SmallClass, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE Q_DECLARE_METATYPE(SmallClass); -void tst_qvariant::testBound() +void tst_QVariant::testBound() { qreal d = qreal(.5); QBENCHMARK { @@ -148,7 +148,7 @@ void variantCreation<SmallClass>(SmallClass val) } template <> -void variantCreation<tst_qvariant::ABenchmarkEnum>(tst_qvariant::ABenchmarkEnum val) +void variantCreation<tst_QVariant::ABenchmarkEnum>(tst_QVariant::ABenchmarkEnum val) { QBENCHMARK { for (int i = 0; i < ITERATION_COUNT; ++i) { @@ -158,49 +158,49 @@ void variantCreation<tst_qvariant::ABenchmarkEnum>(tst_qvariant::ABenchmarkEnum } -void tst_qvariant::doubleVariantCreation() +void tst_QVariant::doubleVariantCreation() { variantCreation<double>(0.0); } -void tst_qvariant::floatVariantCreation() +void tst_QVariant::floatVariantCreation() { variantCreation<float>(0.0f); } -void tst_qvariant::rectVariantCreation() +void tst_QVariant::rectVariantCreation() { variantCreation<QRect>(QRect(1, 2, 3, 4)); } -void tst_qvariant::stringVariantCreation() +void tst_QVariant::stringVariantCreation() { variantCreation<QString>(QString()); } #ifdef QT_GUI_LIB -void tst_qvariant::pixmapVariantCreation() +void tst_QVariant::pixmapVariantCreation() { variantCreation<QPixmap>(QPixmap()); } #endif -void tst_qvariant::stringListVariantCreation() +void tst_QVariant::stringListVariantCreation() { variantCreation<QStringList>(QStringList()); } -void tst_qvariant::bigClassVariantCreation() +void tst_QVariant::bigClassVariantCreation() { variantCreation<BigClass>(BigClass()); } -void tst_qvariant::smallClassVariantCreation() +void tst_QVariant::smallClassVariantCreation() { variantCreation<SmallClass>(SmallClass()); } -void tst_qvariant::enumVariantCreation() +void tst_QVariant::enumVariantCreation() { variantCreation<ABenchmarkEnum>(FirstEnumValue); } @@ -217,42 +217,42 @@ static void variantSetValue(T d) } } -void tst_qvariant::doubleVariantSetValue() +void tst_QVariant::doubleVariantSetValue() { variantSetValue<double>(0.0); } -void tst_qvariant::floatVariantSetValue() +void tst_QVariant::floatVariantSetValue() { variantSetValue<float>(0.0f); } -void tst_qvariant::rectVariantSetValue() +void tst_QVariant::rectVariantSetValue() { variantSetValue<QRect>(QRect()); } -void tst_qvariant::stringVariantSetValue() +void tst_QVariant::stringVariantSetValue() { variantSetValue<QString>(QString()); } -void tst_qvariant::stringListVariantSetValue() +void tst_QVariant::stringListVariantSetValue() { variantSetValue<QStringList>(QStringList()); } -void tst_qvariant::bigClassVariantSetValue() +void tst_QVariant::bigClassVariantSetValue() { variantSetValue<BigClass>(BigClass()); } -void tst_qvariant::smallClassVariantSetValue() +void tst_QVariant::smallClassVariantSetValue() { variantSetValue<SmallClass>(SmallClass()); } -void tst_qvariant::enumVariantSetValue() +void tst_QVariant::enumVariantSetValue() { variantSetValue<ABenchmarkEnum>(FirstEnumValue); } @@ -268,32 +268,32 @@ static void variantAssignment(T d) } } -void tst_qvariant::doubleVariantAssignment() +void tst_QVariant::doubleVariantAssignment() { variantAssignment<double>(0.0); } -void tst_qvariant::floatVariantAssignment() +void tst_QVariant::floatVariantAssignment() { variantAssignment<float>(0.0f); } -void tst_qvariant::rectVariantAssignment() +void tst_QVariant::rectVariantAssignment() { variantAssignment<QRect>(QRect()); } -void tst_qvariant::stringVariantAssignment() +void tst_QVariant::stringVariantAssignment() { variantAssignment<QString>(QString()); } -void tst_qvariant::stringListVariantAssignment() +void tst_QVariant::stringListVariantAssignment() { variantAssignment<QStringList>(QStringList()); } -void tst_qvariant::doubleVariantValue() +void tst_QVariant::doubleVariantValue() { QVariant v(0.0); QBENCHMARK { @@ -303,7 +303,7 @@ void tst_qvariant::doubleVariantValue() } } -void tst_qvariant::floatVariantValue() +void tst_QVariant::floatVariantValue() { QVariant v(0.0f); QBENCHMARK { @@ -313,7 +313,7 @@ void tst_qvariant::floatVariantValue() } } -void tst_qvariant::rectVariantValue() +void tst_QVariant::rectVariantValue() { QVariant v(QRect(1,2,3,4)); QBENCHMARK { @@ -323,7 +323,7 @@ void tst_qvariant::rectVariantValue() } } -void tst_qvariant::stringVariantValue() +void tst_QVariant::stringVariantValue() { QVariant v = QString(); QBENCHMARK { @@ -333,7 +333,7 @@ void tst_qvariant::stringVariantValue() } } -void tst_qvariant::createCoreType_data() +void tst_QVariant::createCoreType_data() { QTest::addColumn<int>("typeId"); for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) { @@ -346,7 +346,7 @@ void tst_qvariant::createCoreType_data() // QVariant. The purpose of this benchmark is to measure the overhead // of creating (and destroying) a QVariant compared to creating the // type directly. -void tst_qvariant::createCoreType() +void tst_QVariant::createCoreType() { QFETCH(int, typeId); QBENCHMARK { @@ -355,7 +355,7 @@ void tst_qvariant::createCoreType() } } -void tst_qvariant::createCoreTypeCopy_data() +void tst_QVariant::createCoreTypeCopy_data() { createCoreType_data(); } @@ -364,7 +364,7 @@ void tst_qvariant::createCoreTypeCopy_data() // QVariant. The purpose of this benchmark is to measure the overhead // of creating (and destroying) a QVariant compared to creating the // type directly. -void tst_qvariant::createCoreTypeCopy() +void tst_QVariant::createCoreTypeCopy() { QFETCH(int, typeId); QMetaType metaType(typeId); @@ -376,6 +376,6 @@ void tst_qvariant::createCoreTypeCopy() } } -QTEST_MAIN(tst_qvariant) +QTEST_MAIN(tst_QVariant) -#include "tst_qvariant.moc" +#include "tst_bench_qvariant.moc" diff --git a/tests/benchmarks/corelib/kernel/qwineventnotifier/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qwineventnotifier/CMakeLists.txt index a581b1eaef..046564ba8e 100644 --- a/tests/benchmarks/corelib/kernel/qwineventnotifier/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qwineventnotifier/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qwineventnotifier.pro. - ##################################################################### ## tst_bench_qwineventnotifier Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qwineventnotifier SOURCES - main.cpp + tst_bench_qwineventnotifier.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qwineventnotifier.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/kernel/qwineventnotifier/main.cpp b/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp index 926ed5acdb..33f82731ca 100644 --- a/tests/benchmarks/corelib/kernel/qwineventnotifier/main.cpp +++ b/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp @@ -34,7 +34,7 @@ #include <QtCore/qelapsedtimer.h> #include <QtCore/qt_windows.h> -class QWinEventNotifierBenchmark : public QObject +class tst_QWinEventNotifier : public QObject { Q_OBJECT @@ -102,7 +102,7 @@ protected: int numberOfIterations; }; -void QWinEventNotifierBenchmark::waves_data() +void tst_QWinEventNotifier::waves_data() { QTest::addColumn<int>("waves"); QTest::addColumn<int>("notifiers"); @@ -112,7 +112,7 @@ void QWinEventNotifierBenchmark::waves_data() } } -void QWinEventNotifierBenchmark::waves() +void tst_QWinEventNotifier::waves() { QFETCH(int, waves); QFETCH(int, notifiers); @@ -131,6 +131,6 @@ void QWinEventNotifierBenchmark::waves() emit factory.stop(); } -QTEST_MAIN(QWinEventNotifierBenchmark) +QTEST_MAIN(tst_QWinEventNotifier) -#include "main.moc" +#include "tst_bench_qwineventnotifier.moc" diff --git a/tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt b/tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt index 7adc043639..9bddaf57bc 100644 --- a/tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt +++ b/tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qmimedatabase.pro. - ##################################################################### ## tst_bench_qmimedatabase Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qmimedatabase SOURCES - main.cpp + tst_bench_qmimedatabase.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp b/tests/benchmarks/corelib/mimetypes/qmimedatabase/tst_bench_qmimedatabase.cpp index 900e7028a4..fb2a500982 100644 --- a/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp +++ b/tests/benchmarks/corelib/mimetypes/qmimedatabase/tst_bench_qmimedatabase.cpp @@ -83,4 +83,5 @@ void tst_QMimeDatabase::benchMimeTypeForName() } QTEST_MAIN(tst_QMimeDatabase) -#include "main.moc" + +#include "tst_bench_qmimedatabase.moc" diff --git a/tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt b/tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt index 3b787dc8e8..66ec60effc 100644 --- a/tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt +++ b/tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from quuid.pro. - ##################################################################### ## tst_bench_quuid Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_quuid SOURCES - tst_quuid.cpp + tst_bench_quuid.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:quuid.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp b/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp index 0bc0a7de93..2db1563568 100644 --- a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp +++ b/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp @@ -30,14 +30,10 @@ #include <QtCore/QUuid> #include <QTest> -class tst_bench_QUuid : public QObject +class tst_QUuid : public QObject { Q_OBJECT -public: - tst_bench_QUuid() - { } - private slots: void createUuid(); void fromChar(); @@ -56,21 +52,21 @@ private slots: void operatorMore(); }; -void tst_bench_QUuid::createUuid() +void tst_QUuid::createUuid() { QBENCHMARK { QUuid::createUuid(); } } -void tst_bench_QUuid::fromChar() +void tst_QUuid::fromChar() { QBENCHMARK { QUuid uuid("{67C8770B-44F1-410A-AB9A-F9B5446F13EE}"); } } -void tst_bench_QUuid::toString() +void tst_QUuid::toString() { QUuid uuid = QUuid::createUuid(); QBENCHMARK { @@ -78,7 +74,7 @@ void tst_bench_QUuid::toString() } } -void tst_bench_QUuid::fromString() +void tst_QUuid::fromString() { QString string = "{67C8770B-44F1-410A-AB9A-F9B5446F13EE}"; QBENCHMARK { @@ -86,7 +82,7 @@ void tst_bench_QUuid::fromString() } } -void tst_bench_QUuid::toByteArray() +void tst_QUuid::toByteArray() { QUuid uuid = QUuid::createUuid(); QBENCHMARK { @@ -94,7 +90,7 @@ void tst_bench_QUuid::toByteArray() } } -void tst_bench_QUuid::fromByteArray() +void tst_QUuid::fromByteArray() { QByteArray string = "{67C8770B-44F1-410A-AB9A-F9B5446F13EE}"; QBENCHMARK { @@ -102,7 +98,7 @@ void tst_bench_QUuid::fromByteArray() } } -void tst_bench_QUuid::toRfc4122() +void tst_QUuid::toRfc4122() { QUuid uuid = QUuid::createUuid(); QBENCHMARK { @@ -110,7 +106,7 @@ void tst_bench_QUuid::toRfc4122() } } -void tst_bench_QUuid::fromRfc4122() +void tst_QUuid::fromRfc4122() { QByteArray string = QByteArray::fromHex("67C8770B44F1410AAB9AF9B5446F13EE"); QBENCHMARK { @@ -119,7 +115,7 @@ void tst_bench_QUuid::fromRfc4122() } } -void tst_bench_QUuid::createUuidV3() +void tst_QUuid::createUuidV3() { QUuid ns = QUuid::createUuid(); QByteArray name = QByteArray("Test"); @@ -129,7 +125,7 @@ void tst_bench_QUuid::createUuidV3() } } -void tst_bench_QUuid::createUuidV5() +void tst_QUuid::createUuidV5() { QUuid ns = QUuid::createUuid(); QByteArray name = QByteArray("Test"); @@ -139,7 +135,7 @@ void tst_bench_QUuid::createUuidV5() } } -void tst_bench_QUuid::toDataStream() +void tst_QUuid::toDataStream() { QUuid uuid = QUuid::createUuid(); QByteArray ar; @@ -151,7 +147,7 @@ void tst_bench_QUuid::toDataStream() } } -void tst_bench_QUuid::fromDataStream() +void tst_QUuid::fromDataStream() { QUuid uuid1, uuid2; uuid1 = QUuid::createUuid(); @@ -168,7 +164,7 @@ void tst_bench_QUuid::fromDataStream() } } -void tst_bench_QUuid::isNull() +void tst_QUuid::isNull() { QUuid uuid = QUuid(); QBENCHMARK { @@ -176,7 +172,7 @@ void tst_bench_QUuid::isNull() } } -void tst_bench_QUuid::operatorLess() +void tst_QUuid::operatorLess() { QUuid uuid1, uuid2; uuid1 = QUuid::createUuid(); @@ -186,7 +182,7 @@ void tst_bench_QUuid::operatorLess() } } -void tst_bench_QUuid::operatorMore() +void tst_QUuid::operatorMore() { QUuid uuid1, uuid2; uuid1 = QUuid::createUuid(); @@ -196,5 +192,6 @@ void tst_bench_QUuid::operatorMore() } } -QTEST_MAIN(tst_bench_QUuid); -#include "tst_quuid.moc" +QTEST_MAIN(tst_QUuid) + +#include "tst_bench_quuid.moc" diff --git a/tests/benchmarks/corelib/text/qbytearray/CMakeLists.txt b/tests/benchmarks/corelib/text/qbytearray/CMakeLists.txt index 50574aa221..18b811501b 100644 --- a/tests/benchmarks/corelib/text/qbytearray/CMakeLists.txt +++ b/tests/benchmarks/corelib/text/qbytearray/CMakeLists.txt @@ -1,16 +1,10 @@ -# Generated from qbytearray.pro. - ##################################################################### ## tst_bench_qbytearray Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qbytearray SOURCES - main.cpp + tst_bench_qbytearray.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qbytearray.pro:<TRUE>: -# TEMPLATE = "app" -# TESTDATA = "main.cpp" diff --git a/tests/benchmarks/corelib/text/qbytearray/main.cpp b/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp index 43151041d0..01ee46c53e 100644 --- a/tests/benchmarks/corelib/text/qbytearray/main.cpp +++ b/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp @@ -34,8 +34,7 @@ #include <qtest.h> #include <limits> - -class tst_qbytearray : public QObject +class tst_QByteArray : public QObject { Q_OBJECT QByteArray sourcecode; @@ -59,14 +58,14 @@ private slots: void toPercentEncoding(); }; -void tst_qbytearray::initTestCase() +void tst_QByteArray::initTestCase() { - QFile self(QFINDTESTDATA("main.cpp")); + QFile self(QFINDTESTDATA("tst_bench_qbytearray.cpp")); QVERIFY(self.open(QIODevice::ReadOnly)); sourcecode = self.readAll(); } -void tst_qbytearray::append_data() +void tst_QByteArray::append_data() { QTest::addColumn<int>("size"); QTest::newRow("1") << int(1); @@ -80,7 +79,7 @@ void tst_qbytearray::append_data() QTest::newRow("100000000") << int(100000000); } -void tst_qbytearray::append() +void tst_QByteArray::append() { QFETCH(int, size); @@ -106,7 +105,7 @@ static QByteArray decNext(QByteArray &&big) return big; } -void tst_qbytearray::toLongLong_data() +void tst_QByteArray::toLongLong_data() { QTest::addColumn<QByteArray>("text"); QTest::addColumn<bool>("good"); @@ -127,7 +126,7 @@ void tst_qbytearray::toLongLong_data() QTest::newRow("max+1") << decNext(QByteArray::number(LL::max())) << false << 0LL; } -void tst_qbytearray::toLongLong() +void tst_QByteArray::toLongLong() { QFETCH(QByteArray, text); QFETCH(bool, good); @@ -142,7 +141,7 @@ void tst_qbytearray::toLongLong() QCOMPARE(ok, good); } -void tst_qbytearray::toULongLong_data() +void tst_QByteArray::toULongLong_data() { QTest::addColumn<QByteArray>("text"); QTest::addColumn<bool>("good"); @@ -160,7 +159,7 @@ void tst_qbytearray::toULongLong_data() QTest::newRow("max+1") << decNext(QByteArray::number(ULL::max())) << false << 0ULL; } -void tst_qbytearray::toULongLong() +void tst_QByteArray::toULongLong() { QFETCH(QByteArray, text); QFETCH(bool, good); @@ -175,7 +174,7 @@ void tst_qbytearray::toULongLong() QCOMPARE(ok, good); } -void tst_qbytearray::latin1Uppercasing_qt54() +void tst_QByteArray::latin1Uppercasing_qt54() { QByteArray s = sourcecode; s.detach(); @@ -224,7 +223,7 @@ static const uchar uppercased[256] = { 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, 0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xf7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xff }; -void tst_qbytearray::latin1Uppercasing_xlate() +void tst_QByteArray::latin1Uppercasing_xlate() { QByteArray output = sourcecode; output.detach(); @@ -238,7 +237,7 @@ void tst_qbytearray::latin1Uppercasing_xlate() } } -void tst_qbytearray::latin1Uppercasing_xlate_checked() +void tst_QByteArray::latin1Uppercasing_xlate_checked() { QByteArray output = sourcecode; output.detach(); @@ -291,7 +290,7 @@ static const char categories[256] = { 2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,0 }; -void tst_qbytearray::latin1Uppercasing_category() +void tst_QByteArray::latin1Uppercasing_category() { QByteArray output = sourcecode; output.detach(); @@ -336,7 +335,7 @@ static bool bittest(const quint32 *data, uchar bit) return data[bit / bitsperelem] & (1 << (bit & (bitsperelem - 1))); } -void tst_qbytearray::latin1Uppercasing_bitcheck() +void tst_QByteArray::latin1Uppercasing_bitcheck() { QByteArray output = sourcecode; output.detach(); @@ -350,7 +349,7 @@ void tst_qbytearray::latin1Uppercasing_bitcheck() } } -void tst_qbytearray::toPercentEncoding_data() +void tst_QByteArray::toPercentEncoding_data() { QTest::addColumn<QByteArray>("plaintext"); QTest::addColumn<QByteArray>("expected"); @@ -369,7 +368,7 @@ void tst_qbytearray::toPercentEncoding_data() "%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D%7F"); } -void tst_qbytearray::toPercentEncoding() +void tst_QByteArray::toPercentEncoding() { QFETCH(QByteArray, plaintext); QByteArray encoded; @@ -379,6 +378,6 @@ void tst_qbytearray::toPercentEncoding() QTEST(encoded, "expected"); } -QTEST_MAIN(tst_qbytearray) +QTEST_MAIN(tst_QByteArray) -#include "main.moc" +#include "tst_bench_qbytearray.moc" diff --git a/tests/benchmarks/corelib/text/qchar/CMakeLists.txt b/tests/benchmarks/corelib/text/qchar/CMakeLists.txt index afdf96e9d4..ef7f553f2e 100644 --- a/tests/benchmarks/corelib/text/qchar/CMakeLists.txt +++ b/tests/benchmarks/corelib/text/qchar/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qchar.pro. - ##################################################################### ## tst_bench_qchar Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qchar SOURCES - main.cpp + tst_bench_qchar.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/text/qchar/main.cpp b/tests/benchmarks/corelib/text/qchar/tst_bench_qchar.cpp index 746f9730f7..b1adfdca4e 100644 --- a/tests/benchmarks/corelib/text/qchar/main.cpp +++ b/tests/benchmarks/corelib/text/qchar/tst_bench_qchar.cpp @@ -133,4 +133,4 @@ void tst_QChar::isSpace() QTEST_MAIN(tst_QChar) -#include "main.moc" +#include "tst_bench_qchar.moc" diff --git a/tests/benchmarks/corelib/text/qlocale/CMakeLists.txt b/tests/benchmarks/corelib/text/qlocale/CMakeLists.txt index 1c692af6c8..f319c0b5bd 100644 --- a/tests/benchmarks/corelib/text/qlocale/CMakeLists.txt +++ b/tests/benchmarks/corelib/text/qlocale/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qlocale.pro. - ##################################################################### ## tst_bench_qlocale Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qlocale SOURCES - main.cpp + tst_bench_qlocale.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/text/qlocale/main.cpp b/tests/benchmarks/corelib/text/qlocale/tst_bench_qlocale.cpp index 887053ae4a..23a64526eb 100644 --- a/tests/benchmarks/corelib/text/qlocale/main.cpp +++ b/tests/benchmarks/corelib/text/qlocale/tst_bench_qlocale.cpp @@ -394,4 +394,4 @@ void tst_QLocale::number_QString() QTEST_MAIN(tst_QLocale) -#include "main.moc" +#include "tst_bench_qlocale.moc" diff --git a/tests/benchmarks/corelib/text/qstringbuilder/CMakeLists.txt b/tests/benchmarks/corelib/text/qstringbuilder/CMakeLists.txt index 33b1b5fe5e..b450aa50a0 100644 --- a/tests/benchmarks/corelib/text/qstringbuilder/CMakeLists.txt +++ b/tests/benchmarks/corelib/text/qstringbuilder/CMakeLists.txt @@ -1,18 +1,12 @@ -# Generated from qstringbuilder.pro. - ##################################################################### ## tst_bench_qstringbuilder Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qstringbuilder SOURCES - main.cpp + tst_bench_qstringbuilder.cpp PUBLIC_LIBRARIES Qt::Test COMPILE_OPTIONS -g ) - -#### Keys ignored in scope 1:.:.:qstringbuilder.pro:<TRUE>: -# QMAKE_CFLAGS = "-g" -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/text/qstringbuilder/main.cpp b/tests/benchmarks/corelib/text/qstringbuilder/tst_bench_qstringbuilder.cpp index 757e2cc683..acb7c14169 100644 --- a/tests/benchmarks/corelib/text/qstringbuilder/main.cpp +++ b/tests/benchmarks/corelib/text/qstringbuilder/tst_bench_qstringbuilder.cpp @@ -96,12 +96,12 @@ #define LITERAL "some string literal" -class tst_qstringbuilder : public QObject +class tst_QStringBuilder : public QObject { Q_OBJECT public: - tst_qstringbuilder() + tst_QStringBuilder() : l1literal(LITERAL), l1string(LITERAL), ba(LITERAL), @@ -408,8 +408,8 @@ private: std::string stdr; }; -QTEST_MAIN(tst_qstringbuilder) - #undef P -#include "main.moc" +QTEST_MAIN(tst_QStringBuilder) + +#include "tst_bench_qstringbuilder.moc" diff --git a/tests/benchmarks/corelib/text/qstringlist/CMakeLists.txt b/tests/benchmarks/corelib/text/qstringlist/CMakeLists.txt index 4649e3408a..58af3c9dd3 100644 --- a/tests/benchmarks/corelib/text/qstringlist/CMakeLists.txt +++ b/tests/benchmarks/corelib/text/qstringlist/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qstringlist.pro. - ##################################################################### ## tst_bench_qstringlist Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qstringlist SOURCES - main.cpp + tst_bench_qstringlist.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/text/qstringlist/main.cpp b/tests/benchmarks/corelib/text/qstringlist/tst_bench_qstringlist.cpp index 5c54bcebc5..327f4dc1a1 100644 --- a/tests/benchmarks/corelib/text/qstringlist/main.cpp +++ b/tests/benchmarks/corelib/text/qstringlist/tst_bench_qstringlist.cpp @@ -237,4 +237,4 @@ void tst_QStringList::split_stdlist_stdstring() const QTEST_MAIN(tst_QStringList) -#include "main.moc" +#include "tst_bench_qstringlist.moc" diff --git a/tests/benchmarks/corelib/text/qstringtokenizer/CMakeLists.txt b/tests/benchmarks/corelib/text/qstringtokenizer/CMakeLists.txt index c2bf848400..92dd6cec98 100644 --- a/tests/benchmarks/corelib/text/qstringtokenizer/CMakeLists.txt +++ b/tests/benchmarks/corelib/text/qstringtokenizer/CMakeLists.txt @@ -4,7 +4,7 @@ qt_internal_add_benchmark(tst_bench_qstringtokenizer SOURCES - main.cpp + tst_bench_qstringtokenizer.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/text/qstringtokenizer/main.cpp b/tests/benchmarks/corelib/text/qstringtokenizer/tst_bench_qstringtokenizer.cpp index 54f48d5ea5..291b314a7f 100644 --- a/tests/benchmarks/corelib/text/qstringtokenizer/main.cpp +++ b/tests/benchmarks/corelib/text/qstringtokenizer/tst_bench_qstringtokenizer.cpp @@ -142,4 +142,4 @@ void tst_QStringTokenizer::tokenize() const QTEST_MAIN(tst_QStringTokenizer) -#include "main.moc" +#include "tst_bench_qstringtokenizer.moc" diff --git a/tests/benchmarks/corelib/thread/qfuture/CMakeLists.txt b/tests/benchmarks/corelib/thread/qfuture/CMakeLists.txt index 4a737c62b8..d53e3f6728 100644 --- a/tests/benchmarks/corelib/thread/qfuture/CMakeLists.txt +++ b/tests/benchmarks/corelib/thread/qfuture/CMakeLists.txt @@ -5,7 +5,7 @@ qt_internal_add_benchmark(tst_bench_qfuture EXCEPTIONS SOURCES - tst_qfuture.cpp + tst_bench_qfuture.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/thread/qfuture/tst_qfuture.cpp b/tests/benchmarks/corelib/thread/qfuture/tst_bench_qfuture.cpp index c7a4ff24d9..17c2f20712 100644 --- a/tests/benchmarks/corelib/thread/qfuture/tst_qfuture.cpp +++ b/tests/benchmarks/corelib/thread/qfuture/tst_bench_qfuture.cpp @@ -317,4 +317,5 @@ void tst_QFuture::progressText() } QTEST_MAIN(tst_QFuture) -#include "tst_qfuture.moc" + +#include "tst_bench_qfuture.moc" diff --git a/tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt b/tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt index 923bfba117..d056a10568 100644 --- a/tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt +++ b/tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt @@ -1,16 +1,11 @@ -# Generated from qmutex.pro. - ##################################################################### ## tst_bench_qmutex Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qmutex SOURCES - tst_qmutex.cpp + tst_bench_qmutex.cpp PUBLIC_LIBRARIES Qt::CorePrivate Qt::Test ) - -#### Keys ignored in scope 1:.:.:qmutex.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_bench_qmutex.cpp index 9b14cbca5d..987612b7b2 100644 --- a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/benchmarks/corelib/thread/qmutex/tst_bench_qmutex.cpp @@ -450,4 +450,5 @@ void tst_QMutex::contendedQMutexLocker() } QTEST_MAIN(tst_QMutex) -#include "tst_qmutex.moc" + +#include "tst_bench_qmutex.moc" diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/CMakeLists.txt b/tests/benchmarks/corelib/thread/qreadwritelock/CMakeLists.txt index 79d3a2f879..901f9609bc 100644 --- a/tests/benchmarks/corelib/thread/qreadwritelock/CMakeLists.txt +++ b/tests/benchmarks/corelib/thread/qreadwritelock/CMakeLists.txt @@ -1,16 +1,11 @@ -# Generated from qreadwritelock.pro. - ##################################################################### ## tst_bench_qreadwritelock Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qreadwritelock SOURCES - tst_qreadwritelock.cpp + tst_bench_qreadwritelock.cpp PUBLIC_LIBRARIES Qt::CorePrivate Qt::Test ) - -#### Keys ignored in scope 1:.:.:qreadwritelock.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp index 1018dae878..f0ec45e267 100644 --- a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp +++ b/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp @@ -256,4 +256,4 @@ void tst_QReadWriteLock::writeOnly() } QTEST_MAIN(tst_QReadWriteLock) -#include "tst_qreadwritelock.moc" +#include "tst_bench_qreadwritelock.moc" diff --git a/tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt b/tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt index 7b0c81891e..0d1f145e25 100644 --- a/tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt +++ b/tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qthreadpool.pro. - ##################################################################### ## tst_bench_qthreadpool Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qthreadpool SOURCES - tst_qthreadpool.cpp + tst_bench_qthreadpool.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qthreadpool.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/benchmarks/corelib/thread/qthreadpool/tst_bench_qthreadpool.cpp index 10928e3afc..a64dbd15c9 100644 --- a/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/benchmarks/corelib/thread/qthreadpool/tst_bench_qthreadpool.cpp @@ -76,4 +76,5 @@ void tst_QThreadPool::activeThreadCount() } QTEST_MAIN(tst_QThreadPool) -#include "tst_qthreadpool.moc" + +#include "tst_bench_qthreadpool.moc" diff --git a/tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt b/tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt index 78ac072d35..7f5de4e9ab 100644 --- a/tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt +++ b/tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qthreadstorage.pro. - ##################################################################### ## tst_bench_qthreadstorage Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qthreadstorage SOURCES - tst_qthreadstorage.cpp + tst_bench_qthreadstorage.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qthreadstorage.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/benchmarks/corelib/thread/qthreadstorage/tst_bench_qthreadstorage.cpp index c8f9f23c76..6230cd3187 100644 --- a/tests/benchmarks/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/benchmarks/corelib/thread/qthreadstorage/tst_bench_qthreadstorage.cpp @@ -104,6 +104,6 @@ void tst_QThreadStorage::set() ts.setLocalData(0); } - QTEST_MAIN(tst_QThreadStorage) -#include "tst_qthreadstorage.moc" + +#include "tst_bench_qthreadstorage.moc" diff --git a/tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt b/tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt index 68c6e88342..13814d7074 100644 --- a/tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt +++ b/tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qwaitcondition.pro. - ##################################################################### ## tst_bench_qwaitcondition Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qwaitcondition SOURCES - tst_qwaitcondition.cpp + tst_bench_qwaitcondition.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qwaitcondition.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/benchmarks/corelib/thread/qwaitcondition/tst_bench_qwaitcondition.cpp index b87da463dc..19d3964c7a 100644 --- a/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/benchmarks/corelib/thread/qwaitcondition/tst_bench_qwaitcondition.cpp @@ -124,6 +124,6 @@ void tst_QWaitCondition::oscillate_writelock() oscillate<QReadWriteLock, QWriteLocker>(timeout); } - QTEST_MAIN(tst_QWaitCondition) -#include "tst_qwaitcondition.moc" + +#include "tst_bench_qwaitcondition.moc" diff --git a/tests/benchmarks/corelib/time/qdatetime/CMakeLists.txt b/tests/benchmarks/corelib/time/qdatetime/CMakeLists.txt index 2585b0d25d..a9546f3cad 100644 --- a/tests/benchmarks/corelib/time/qdatetime/CMakeLists.txt +++ b/tests/benchmarks/corelib/time/qdatetime/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qdatetime.pro. - ##################################################################### ## tst_bench_qdatetime Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qdatetime SOURCES - main.cpp + tst_bench_qdatetime.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/time/qdatetime/main.cpp b/tests/benchmarks/corelib/time/qdatetime/tst_bench_qdatetime.cpp index c6d2b84597..302cf80abf 100644 --- a/tests/benchmarks/corelib/time/qdatetime/main.cpp +++ b/tests/benchmarks/corelib/time/qdatetime/tst_bench_qdatetime.cpp @@ -571,4 +571,4 @@ void tst_QDateTime::fromMSecsSinceEpochTz() QTEST_MAIN(tst_QDateTime) -#include "main.moc" +#include "tst_bench_qdatetime.moc" diff --git a/tests/benchmarks/corelib/time/qtimezone/CMakeLists.txt b/tests/benchmarks/corelib/time/qtimezone/CMakeLists.txt index c6487499af..99d8b7f044 100644 --- a/tests/benchmarks/corelib/time/qtimezone/CMakeLists.txt +++ b/tests/benchmarks/corelib/time/qtimezone/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qtimezone.pro. - ##################################################################### ## tst_bench_qtimezone Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qtimezone SOURCES - main.cpp + tst_bench_qtimezone.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/time/qtimezone/main.cpp b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp index 509d62d3bb..36bb1dd24f 100644 --- a/tests/benchmarks/corelib/time/qtimezone/main.cpp +++ b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp @@ -163,4 +163,4 @@ void tst_QTimeZone::transitionsReverse() QTEST_MAIN(tst_QTimeZone) -#include "main.moc" +#include "tst_bench_qtimezone.moc" diff --git a/tests/benchmarks/corelib/tools/CMakeLists.txt b/tests/benchmarks/corelib/tools/CMakeLists.txt index 805aa92229..25cc02ad1d 100644 --- a/tests/benchmarks/corelib/tools/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/CMakeLists.txt @@ -1,13 +1,13 @@ -# Generated from tools.pro. - add_subdirectory(containers-associative) add_subdirectory(containers-sequential) add_subdirectory(qcontiguouscache) add_subdirectory(qcryptographichash) +add_subdirectory(qhash) add_subdirectory(qlist) add_subdirectory(qmap) add_subdirectory(qrect) add_subdirectory(qringbuffer) +add_subdirectory(qset) add_subdirectory(qsharedpointer) add_subdirectory(qstack) add_subdirectory(qvector) diff --git a/tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt b/tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt index 1e653fa98d..50bf8a0c0f 100644 --- a/tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from containers-associative.pro. - ##################################################################### -## tst_bench_containers-associative Binary: +## tst_bench_containers_associative Binary: ##################################################################### -qt_internal_add_benchmark(tst_bench_containers-associative +qt_internal_add_benchmark(tst_bench_containers_associative SOURCES - main.cpp + tst_bench_containers_associative.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:containers-associative.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/tools/containers-associative/main.cpp b/tests/benchmarks/corelib/tools/containers-associative/tst_bench_containers_associative.cpp index 555d4bf843..6bab99cad7 100644 --- a/tests/benchmarks/corelib/tools/containers-associative/main.cpp +++ b/tests/benchmarks/corelib/tools/containers-associative/tst_bench_containers_associative.cpp @@ -127,4 +127,5 @@ void tst_associative_containers::lookup() } QTEST_MAIN(tst_associative_containers) -#include "main.moc" + +#include "tst_bench_containers_associative.moc" diff --git a/tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt b/tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt index f8ebc69c29..2e6d26e343 100644 --- a/tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from containers-sequential.pro. - ##################################################################### ## tst_bench_containers-sequential Binary: ##################################################################### -qt_internal_add_benchmark(tst_bench_containers-sequential +qt_internal_add_benchmark(tst_bench_containers_sequential SOURCES - main.cpp + tst_bench_containers_sequential.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:containers-sequential.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp b/tests/benchmarks/corelib/tools/containers-sequential/tst_bench_containers_sequential.cpp index 1bb1a02a24..55d4cc72df 100644 --- a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp +++ b/tests/benchmarks/corelib/tools/containers-sequential/tst_bench_containers_sequential.cpp @@ -244,4 +244,5 @@ void tst_vector_vs_std::lookup_Large() } QTEST_MAIN(tst_vector_vs_std) -#include "main.moc" + +#include "tst_bench_containers_sequential.moc" diff --git a/tests/benchmarks/corelib/tools/qcontiguouscache/CMakeLists.txt b/tests/benchmarks/corelib/tools/qcontiguouscache/CMakeLists.txt index e683d60de2..29366ecf36 100644 --- a/tests/benchmarks/corelib/tools/qcontiguouscache/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qcontiguouscache/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qcontiguouscache.pro. - ##################################################################### ## tst_bench_qcontiguouscache Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qcontiguouscache SOURCES - main.cpp + tst_bench_qcontiguouscache.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/tools/qcontiguouscache/main.cpp b/tests/benchmarks/corelib/tools/qcontiguouscache/tst_bench_qcontiguouscache.cpp index 368c8b66bb..bc235b6747 100644 --- a/tests/benchmarks/corelib/tools/qcontiguouscache/main.cpp +++ b/tests/benchmarks/corelib/tools/qcontiguouscache/tst_bench_qcontiguouscache.cpp @@ -46,8 +46,6 @@ private slots: void contiguousCacheBenchmark(); }; -QTEST_MAIN(tst_QContiguousCache) - void tst_QContiguousCache::asScrollingList() { int i; @@ -176,4 +174,6 @@ void tst_QContiguousCache::contiguousCacheBenchmark() } } -#include "main.moc" +QTEST_MAIN(tst_QContiguousCache) + +#include "tst_bench_qcontiguouscache.moc" diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/CMakeLists.txt b/tests/benchmarks/corelib/tools/qcryptographichash/CMakeLists.txt index 2ca8e683e1..e9d539eb1a 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qcryptographichash/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qcryptographichash.pro. - ##################################################################### ## tst_bench_qcryptographichash Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qcryptographichash SOURCES - main.cpp + tst_bench_qcryptographichash.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp index 1f0a7373bb..bff3ddbc26 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp +++ b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp @@ -35,13 +35,13 @@ #include <time.h> -class tst_bench_QCryptographicHash : public QObject +class tst_QCryptographicHash : public QObject { Q_OBJECT QByteArray blockOfData; public: - tst_bench_QCryptographicHash(); + tst_QCryptographicHash(); private Q_SLOTS: void hash_data(); @@ -109,7 +109,7 @@ const char *algoname(int i) return nullptr; } -tst_bench_QCryptographicHash::tst_bench_QCryptographicHash() +tst_QCryptographicHash::tst_QCryptographicHash() : blockOfData(MaxBlockSize, Qt::Uninitialized) { #ifdef Q_OS_UNIX @@ -124,7 +124,7 @@ tst_bench_QCryptographicHash::tst_bench_QCryptographicHash() } } -void tst_bench_QCryptographicHash::hash_data() +void tst_QCryptographicHash::hash_data() { QTest::addColumn<int>("algorithm"); QTest::addColumn<QByteArray>("data"); @@ -139,7 +139,7 @@ void tst_bench_QCryptographicHash::hash_data() } } -void tst_bench_QCryptographicHash::hash() +void tst_QCryptographicHash::hash() { QFETCH(int, algorithm); QFETCH(QByteArray, data); @@ -150,7 +150,7 @@ void tst_bench_QCryptographicHash::hash() } } -void tst_bench_QCryptographicHash::addData() +void tst_QCryptographicHash::addData() { QFETCH(int, algorithm); QFETCH(QByteArray, data); @@ -164,7 +164,7 @@ void tst_bench_QCryptographicHash::addData() } } -void tst_bench_QCryptographicHash::addDataChunked() +void tst_QCryptographicHash::addDataChunked() { QFETCH(int, algorithm); QFETCH(QByteArray, data); @@ -183,6 +183,6 @@ void tst_bench_QCryptographicHash::addDataChunked() } } -QTEST_APPLESS_MAIN(tst_bench_QCryptographicHash) +QTEST_APPLESS_MAIN(tst_QCryptographicHash) -#include "main.moc" +#include "tst_bench_qcryptographichash.moc" diff --git a/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt b/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt index 5286484b0c..437ea285e8 100644 --- a/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qhash/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qhash.pro. - ##################################################################### -## tst_hash Binary: +## tst_bench_qhash Binary: ##################################################################### -qt_internal_add_benchmark(tst_hash +qt_internal_add_benchmark(tst_bench_qhash SOURCES - main.cpp + tst_bench_qhash.cpp outofline.cpp INCLUDE_DIRECTORIES . diff --git a/tests/benchmarks/corelib/tools/qhash/outofline.cpp b/tests/benchmarks/corelib/tools/qhash/outofline.cpp index 4e449e76b4..795b2cbdc6 100644 --- a/tests/benchmarks/corelib/tools/qhash/outofline.cpp +++ b/tests/benchmarks/corelib/tools/qhash/outofline.cpp @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include "main.h" +#include "tst_bench_qhash.h" QT_BEGIN_NAMESPACE diff --git a/tests/benchmarks/corelib/tools/qhash/main.cpp b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.cpp index f9b1624fcc..30778a0c8c 100644 --- a/tests/benchmarks/corelib/tools/qhash/main.cpp +++ b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.cpp @@ -27,7 +27,7 @@ ** ****************************************************************************/ -#include "main.h" +#include "tst_bench_qhash.h" #include <QFile> #include <QHash> @@ -78,7 +78,8 @@ private: void tst_QHash::initTestCase() { - // small list of file paths + // small list of strings (that happen to look like file paths produced long + // ago by cd ../.. && find . -print, but that's irrelevant). QFile smallPathsData(QFINDTESTDATA("paths_small_data.txt")); QVERIFY(smallPathsData.open(QIODevice::ReadOnly)); smallFilePaths = QString::fromLatin1(smallPathsData.readAll()).split(QLatin1Char('\n')); @@ -170,4 +171,4 @@ template <typename String> void tst_QHash::hashing_template() QTEST_MAIN(tst_QHash) -#include "main.moc" +#include "tst_bench_qhash.moc" diff --git a/tests/benchmarks/corelib/tools/qhash/main.h b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h index eca4b61d58..eca4b61d58 100644 --- a/tests/benchmarks/corelib/tools/qhash/main.h +++ b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h diff --git a/tests/benchmarks/corelib/tools/qlist/CMakeLists.txt b/tests/benchmarks/corelib/tools/qlist/CMakeLists.txt index 46ca1c8514..6c9a96399f 100644 --- a/tests/benchmarks/corelib/tools/qlist/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qlist/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qlist.pro. - ##################################################################### ## tst_bench_qlist Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qlist SOURCES - main.cpp + tst_bench_qlist.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/tools/qlist/main.cpp b/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist.cpp index 1f2f8553fe..d83e6eb61c 100644 --- a/tests/benchmarks/corelib/tools/qlist/main.cpp +++ b/tests/benchmarks/corelib/tools/qlist/tst_bench_qlist.cpp @@ -498,4 +498,4 @@ void tst_QList::removeFirstSpecial_impl() const QTEST_APPLESS_MAIN(tst_QList) -#include "main.moc" +#include "tst_bench_qlist.moc" diff --git a/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt b/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt index 30234c7055..e3ce41f7be 100644 --- a/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qrect/CMakeLists.txt @@ -1,15 +1,10 @@ -# Generated from qrect.pro. - ##################################################################### ## tst_bench_qrect Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qrect SOURCES - main.cpp + tst_bench_qrect.cpp PUBLIC_LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qrect.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/tools/qrect/main.cpp b/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp index 7ddf17845c..8850ede4f6 100644 --- a/tests/benchmarks/corelib/tools/qrect/main.cpp +++ b/tests/benchmarks/corelib/tools/qrect/tst_bench_qrect.cpp @@ -30,7 +30,7 @@ #include <QDebug> #include <qtest.h> -class tst_qrect : public QObject +class tst_QRect : public QObject { Q_OBJECT private slots: @@ -159,12 +159,12 @@ static void addRectPointData(bool includeProperArg = false) } } -void tst_qrect::contains_point_data() +void tst_QRect::contains_point_data() { addRectPointData(true); } -void tst_qrect::contains_point() +void tst_QRect::contains_point() { QFETCH(QRectF, rf); QFETCH(QPointF, pf); @@ -176,12 +176,12 @@ void tst_qrect::contains_point() } } -void tst_qrect::contains_rect_data() +void tst_QRect::contains_rect_data() { addRectRectData(true); } -void tst_qrect::contains_rect() +void tst_QRect::contains_rect() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -193,12 +193,12 @@ void tst_qrect::contains_rect() } } -void tst_qrect::intersects_data() +void tst_QRect::intersects_data() { addRectRectData(); } -void tst_qrect::intersects() +void tst_QRect::intersects() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -209,12 +209,12 @@ void tst_qrect::intersects() } } -void tst_qrect::intersected_data() +void tst_QRect::intersected_data() { addRectRectData(); } -void tst_qrect::intersected() +void tst_QRect::intersected() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -225,12 +225,12 @@ void tst_qrect::intersected() } } -void tst_qrect::united_data() +void tst_QRect::united_data() { addRectRectData(); } -void tst_qrect::united() +void tst_QRect::united() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -241,12 +241,12 @@ void tst_qrect::united() } } -void tst_qrect::contains_point_f_data() +void tst_QRect::contains_point_f_data() { addRectPointData(); } -void tst_qrect::contains_point_f() +void tst_QRect::contains_point_f() { QFETCH(QRectF, rf); QFETCH(QPointF, pf); @@ -255,12 +255,12 @@ void tst_qrect::contains_point_f() } } -void tst_qrect::contains_rect_f_data() +void tst_QRect::contains_rect_f_data() { addRectRectData(); } -void tst_qrect::contains_rect_f() +void tst_QRect::contains_rect_f() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -269,12 +269,12 @@ void tst_qrect::contains_rect_f() } } -void tst_qrect::intersects_f_data() +void tst_QRect::intersects_f_data() { addRectRectData(); } -void tst_qrect::intersects_f() +void tst_QRect::intersects_f() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -283,12 +283,12 @@ void tst_qrect::intersects_f() } } -void tst_qrect::intersected_f_data() +void tst_QRect::intersected_f_data() { addRectRectData(); } -void tst_qrect::intersected_f() +void tst_QRect::intersected_f() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -297,12 +297,12 @@ void tst_qrect::intersected_f() } } -void tst_qrect::united_f_data() +void tst_QRect::united_f_data() { addRectRectData(); } -void tst_qrect::united_f() +void tst_QRect::united_f() { QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); @@ -311,6 +311,6 @@ void tst_qrect::united_f() } } -QTEST_MAIN(tst_qrect) +QTEST_MAIN(tst_QRect) -#include "main.moc" +#include "tst_bench_qrect.moc" diff --git a/tests/benchmarks/corelib/tools/qringbuffer/CMakeLists.txt b/tests/benchmarks/corelib/tools/qringbuffer/CMakeLists.txt index 63128f5f95..23a2c990de 100644 --- a/tests/benchmarks/corelib/tools/qringbuffer/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qringbuffer/CMakeLists.txt @@ -1,16 +1,11 @@ -# Generated from qringbuffer.pro. - ##################################################################### ## tst_bench_qringbuffer Binary: ##################################################################### qt_internal_add_benchmark(tst_bench_qringbuffer SOURCES - main.cpp + tst_bench_qringbuffer.cpp PUBLIC_LIBRARIES Qt::CorePrivate Qt::Test ) - -#### Keys ignored in scope 1:.:.:qringbuffer.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/tools/qringbuffer/main.cpp b/tests/benchmarks/corelib/tools/qringbuffer/tst_bench_qringbuffer.cpp index fad30a4e34..ab75688749 100644 --- a/tests/benchmarks/corelib/tools/qringbuffer/main.cpp +++ b/tests/benchmarks/corelib/tools/qringbuffer/tst_bench_qringbuffer.cpp @@ -31,7 +31,7 @@ #include <qtest.h> -class tst_qringbuffer : public QObject +class tst_QRingBuffer : public QObject { Q_OBJECT private slots: @@ -39,7 +39,7 @@ private slots: void free(); }; -void tst_qringbuffer::reserveAndRead() +void tst_QRingBuffer::reserveAndRead() { QRingBuffer ringBuffer; QBENCHMARK { @@ -51,7 +51,7 @@ void tst_qringbuffer::reserveAndRead() } } -void tst_qringbuffer::free() +void tst_QRingBuffer::free() { QRingBuffer ringBuffer; QBENCHMARK { @@ -66,6 +66,6 @@ void tst_qringbuffer::free() } } -QTEST_MAIN(tst_qringbuffer) +QTEST_MAIN(tst_QRingBuffer) -#include "main.moc" +#include "tst_bench_qringbuffer.moc" diff --git a/tests/benchmarks/corelib/tools/qset/CMakeLists.txt b/tests/benchmarks/corelib/tools/qset/CMakeLists.txt index 00fd088776..844226c833 100644 --- a/tests/benchmarks/corelib/tools/qset/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qset/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qset.pro. - ##################################################################### -## tst_qset Binary: +## tst_bench_qset Binary: ##################################################################### -qt_internal_add_benchmark(tst_qset +qt_internal_add_benchmark(tst_bench_qset SOURCES - main.cpp + tst_bench_qset.cpp PUBLIC_LIBRARIES Qt::Test ) diff --git a/tests/benchmarks/corelib/tools/qset/main.cpp b/tests/benchmarks/corelib/tools/qset/tst_bench_qset.cpp index f6c40ec160..4d873f8e39 100644 --- a/tests/benchmarks/corelib/tools/qset/main.cpp +++ b/tests/benchmarks/corelib/tools/qset/tst_bench_qset.cpp @@ -125,4 +125,4 @@ void tst_QSet::intersect_complexType() QTEST_MAIN(tst_QSet) -#include "main.moc" +#include "tst_bench_qset.moc" diff --git a/tests/benchmarks/corelib/tools/qstack/CMakeLists.txt b/tests/benchmarks/corelib/tools/qstack/CMakeLists.txt index 4526af60db..9cd09a0699 100644 --- a/tests/benchmarks/corelib/tools/qstack/CMakeLists.txt +++ b/tests/benchmarks/corelib/tools/qstack/CMakeLists.txt @@ -1,12 +1,10 @@ -# Generated from qstack.pro. - ##################################################################### -## tst_bench_stack Binary: +## tst_bench_qstack Binary: ##################################################################### -qt_internal_add_benchmark(tst_bench_stack +qt_internal_add_benchmark(tst_bench_qstack SOURCES - main.cpp + tst_bench_qstack.cpp PUBLIC_LIBRARIES Qt::CorePrivate Qt::Test diff --git a/tests/benchmarks/corelib/tools/qstack/main.cpp b/tests/benchmarks/corelib/tools/qstack/tst_bench_qstack.cpp index c69e5c3ed8..2f17895f61 100644 --- a/tests/benchmarks/corelib/tools/qstack/main.cpp +++ b/tests/benchmarks/corelib/tools/qstack/tst_bench_qstack.cpp @@ -81,4 +81,4 @@ void tst_QStack::qstack_pushpopone() QTEST_MAIN(tst_QStack) -#include "main.moc" +#include "tst_bench_qstack.moc" |