diff options
Diffstat (limited to 'tests/benchmarks/corelib/kernel')
15 files changed, 40 insertions, 24 deletions
diff --git a/tests/benchmarks/corelib/kernel/CMakeLists.txt b/tests/benchmarks/corelib/kernel/CMakeLists.txt index 0e6d553d3e..137ef37298 100644 --- a/tests/benchmarks/corelib/kernel/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/CMakeLists.txt @@ -1,8 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -# Generated from kernel.pro. - add_subdirectory(events) add_subdirectory(qmetatype) add_subdirectory(qvariant) diff --git a/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp b/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp index 0b310afb94..17eb838af2 100644 --- a/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp +++ b/tests/benchmarks/corelib/kernel/events/tst_bench_events.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <qtest.h> @@ -88,6 +88,7 @@ void EventsBench::noEvent() QBENCHMARK { val += tst.foo(1); } + QVERIFY(val > 0); } void EventsBench::sendEvent_data() diff --git a/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp b/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp index 044acee366..d2ff489784 100644 --- a/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp +++ b/tests/benchmarks/corelib/kernel/qcoreapplication/tst_bench_qcoreapplication.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2011 Robin Burchell <robin+qt@viroteck.net> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <qtest.h> #include <qcoreapplication.h> @@ -10,6 +10,9 @@ Q_OBJECT private slots: void event_posting_benchmark_data(); void event_posting_benchmark(); + + void event_posting_multiple_objects_benchmark_data(); + void event_posting_multiple_objects_benchmark(); }; void tst_QCoreApplication::event_posting_benchmark_data() @@ -39,6 +42,29 @@ void tst_QCoreApplication::event_posting_benchmark() } } +void tst_QCoreApplication::event_posting_multiple_objects_benchmark_data() +{ + event_posting_benchmark_data(); +} + +void tst_QCoreApplication::event_posting_multiple_objects_benchmark() +{ + QFETCH(int, size); + + QObject objects[15]; // The size of the array has not been chosen through any meaningful means + + QRandomGenerator gen; + + // benchmark posting & sending events + QBENCHMARK { + for (int i = 0; i < size; ++i) { + QCoreApplication::postEvent(&objects[gen.bounded(0, int(std::size(objects)))], + new QTimerEvent(i % 10)); + } + QCoreApplication::sendPostedEvents(); + } +} + QTEST_MAIN(tst_QCoreApplication) #include "tst_bench_qcoreapplication.moc" diff --git a/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp b/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp index 3ebbe176d8..1a88c49993 100644 --- a/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp +++ b/tests/benchmarks/corelib/kernel/qmetaenum/tst_bench_qmetaenum.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QMetaEnum> #include <QTest> diff --git a/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp index f539ec2692..6b02fb4ba4 100644 --- a/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp +++ b/tests/benchmarks/corelib/kernel/qmetaobject/tst_bench_qmetaobject.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <QtWidgets/QTreeView> #include <qtest.h> diff --git a/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp b/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp index 95e7bc5dfd..94adfa4a8c 100644 --- a/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp +++ b/tests/benchmarks/corelib/kernel/qmetatype/tst_bench_qmetatype.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QtCore/qmetatype.h> diff --git a/tests/benchmarks/corelib/kernel/qobject/object.cpp b/tests/benchmarks/corelib/kernel/qobject/object.cpp index 049a1a1107..9e0fba2e98 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/object.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "object.h" void Object::emitSignal0() diff --git a/tests/benchmarks/corelib/kernel/qobject/object.h b/tests/benchmarks/corelib/kernel/qobject/object.h index 2f8bf7ca9f..72705f7f34 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.h +++ b/tests/benchmarks/corelib/kernel/qobject/object.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef OBJECT_H #define OBJECT_H diff --git a/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp index f3b3fc098a..99c15f6317 100644 --- a/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <QtWidgets/QTreeView> #include <qtest.h> diff --git a/tests/benchmarks/corelib/kernel/qproperty/propertytester.h b/tests/benchmarks/corelib/kernel/qproperty/propertytester.h index f913395af6..a89d51c286 100644 --- a/tests/benchmarks/corelib/kernel/qproperty/propertytester.h +++ b/tests/benchmarks/corelib/kernel/qproperty/propertytester.h @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef PROPERTYTESTER_H #define PROPERTYTESTER_H diff --git a/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp index 2d57c4c51e..c91ca1ea11 100644 --- a/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp +++ b/tests/benchmarks/corelib/kernel/qproperty/tst_bench_qproperty.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QScopedPointer> #include <QProperty> diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/CMakeLists.txt index d0430ad25c..22e04d98a2 100644 --- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/CMakeLists.txt @@ -1,8 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -# Generated from qtimer_vs_qmetaobject.pro. - ##################################################################### ## qtimer_vs_qmetaobject Binary: ##################################################################### @@ -15,6 +13,3 @@ qt_internal_add_benchmark(qtimer_vs_qmetaobject LIBRARIES Qt::Test ) - -#### Keys ignored in scope 1:.:.:qtimer_vs_qmetaobject.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp index d36ea17756..d0b3e21772 100644 --- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp +++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <QTest> @@ -101,13 +101,9 @@ void qtimer_vs_qmetaobject::bench_data() void qtimer_vs_qmetaobject::benchBackgroundThread() { -#if !QT_CONFIG(cxx11_future) - QSKIP("This test requires QThread::create"); -#else QScopedPointer<QThread> thread(QThread::create([this]() { bench(); })); thread->start(); QVERIFY(thread->wait()); -#endif } QTEST_MAIN(qtimer_vs_qmetaobject) diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp index 157ec9b660..8b2e10c125 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp +++ b/tests/benchmarks/corelib/kernel/qvariant/tst_bench_qvariant.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #ifdef QT_GUI_LIB diff --git a/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp b/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp index 4cfd1247b5..b1f87eabed 100644 --- a/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp +++ b/tests/benchmarks/corelib/kernel/qwineventnotifier/tst_bench_qwineventnotifier.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtCore/qglobal.h> |