diff options
Diffstat (limited to 'tests/benchmarks/corelib/kernel/qobject')
-rw-r--r-- | tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt | 12 | ||||
-rw-r--r-- | tests/benchmarks/corelib/kernel/qobject/object.cpp | 29 | ||||
-rw-r--r-- | tests/benchmarks/corelib/kernel/qobject/object.h | 29 | ||||
-rw-r--r-- | tests/benchmarks/corelib/kernel/qobject/qobject.pro | 7 | ||||
-rw-r--r-- | tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp (renamed from tests/benchmarks/corelib/kernel/qobject/main.cpp) | 57 |
5 files changed, 25 insertions, 109 deletions
diff --git a/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt index 92cffc2980..15b71f0d60 100644 --- a/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qobject/CMakeLists.txt @@ -1,18 +1,16 @@ -# Generated from qobject.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_bench_qobject Binary: ##################################################################### -qt_add_benchmark(tst_bench_qobject +qt_internal_add_benchmark(tst_bench_qobject SOURCES - main.cpp + tst_bench_qobject.cpp object.cpp object.h - PUBLIC_LIBRARIES + 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/object.cpp b/tests/benchmarks/corelib/kernel/qobject/object.cpp index 11da3f09c1..9e0fba2e98 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/object.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// 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 271c4b9ac6..72705f7f34 100644 --- a/tests/benchmarks/corelib/kernel/qobject/object.h +++ b/tests/benchmarks/corelib/kernel/qobject/object.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// 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/qobject.pro b/tests/benchmarks/corelib/kernel/qobject/qobject.pro deleted file mode 100644 index eb1d8a2daa..0000000000 --- a/tests/benchmarks/corelib/kernel/qobject/qobject.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -CONFIG += benchmark -QT += widgets testlib - -TARGET = tst_bench_qobject -HEADERS += object.h -SOURCES += main.cpp object.cpp diff --git a/tests/benchmarks/corelib/kernel/qobject/main.cpp b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp index 918227f74e..99c15f6317 100644 --- a/tests/benchmarks/corelib/kernel/qobject/main.cpp +++ b/tests/benchmarks/corelib/kernel/qobject/tst_bench_qobject.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore> #include <QtWidgets/QTreeView> #include <qtest.h> @@ -37,7 +12,7 @@ enum { SignalsAndSlotsBenchmarkConstant = 456789 }; -class QObjectBenchmark : public QObject +class tst_QObject : public QObject { Q_OBJECT private slots: @@ -95,7 +70,7 @@ inline void allocator() } } -void QObjectBenchmark::stdAllocator() +void tst_QObject::stdAllocator() { allocator<QObjectUsingStandardAllocator>(); } @@ -104,7 +79,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 +90,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 +151,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 +159,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 +173,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 +184,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 +196,7 @@ void QObjectBenchmark::qproperty_benchmark() } } -void QObjectBenchmark::dynamic_property_benchmark() +void tst_QObject::dynamic_property_benchmark() { QTreeView obj; QBENCHMARK { @@ -232,7 +207,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 +218,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 +271,7 @@ void QObjectBenchmark::connect_disconnect_benchmark() } } -void QObjectBenchmark::receiver_destroyed_benchmark() +void tst_QObject::receiver_destroyed_benchmark() { Object sender; QBENCHMARK { @@ -305,6 +280,6 @@ void QObjectBenchmark::receiver_destroyed_benchmark() } } -QTEST_MAIN(QObjectBenchmark) +QTEST_MAIN(tst_QObject) -#include "main.moc" +#include "tst_bench_qobject.moc" |