summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/kernel
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-08-18 11:48:29 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-08-30 19:21:08 +0200
commit9004a2412ba1f9976c2c61f01223dff852208c42 (patch)
treef06abeec8b9cc66abf0e66cc9048c7a0ed02a360 /tests/benchmarks/corelib/kernel
parentc2a6749af795386495b275684418d083410fa1e4 (diff)
Standardise layout and naming in corelib benchmarks
Make file names match CMake's test names (and those follow dir-name) and class names follow tst_ClassName pattern when testing ClassName. Purge comments about the qmake configs the CMakeLists.txt are generated from. Purge empty constructors and init/cleanup methods of classes. Fix petty coding style violations. Add qdir/tree/, qurl, qbench and qset benchmarks to their parent directories' lists of subdirs. Fix unused return error from qurl benchmark. Change-Id: Ifc15a3a46e71cf82ad0637753517e0df34049763 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/benchmarks/corelib/kernel')
-rw-r--r--tests/benchmarks/corelib/kernel/events/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp (renamed from tests/benchmarks/corelib/kernel/events/main.cpp)2
-rw-r--r--tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp (renamed from tests/benchmarks/corelib/kernel/qcoreapplication/main.cpp)10
-rw-r--r--tests/benchmarks/corelib/kernel/qmetaobject/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp (renamed from tests/benchmarks/corelib/kernel/qmetaobject/main.cpp)39
-rw-r--r--tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp (renamed from tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp)2
-rw-r--r--tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp (renamed from tests/benchmarks/corelib/kernel/qobject/main.cpp)28
-rw-r--r--tests/benchmarks/corelib/kernel/qproperty/CMakeLists.txt2
-rw-r--r--tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp (renamed from tests/benchmarks/corelib/kernel/qproperty/main.cpp)31
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt4
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp (renamed from tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp)70
-rw-r--r--tests/benchmarks/corelib/kernel/qwineventnotifier/CMakeLists.txt7
-rw-r--r--tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp (renamed from tests/benchmarks/corelib/kernel/qwineventnotifier/main.cpp)10
16 files changed, 99 insertions, 141 deletions
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"