diff options
Diffstat (limited to 'tests/benchmarks/dbus')
14 files changed, 40 insertions, 162 deletions
diff --git a/tests/benchmarks/dbus/CMakeLists.txt b/tests/benchmarks/dbus/CMakeLists.txt index cd246922a1..03c1599742 100644 --- a/tests/benchmarks/dbus/CMakeLists.txt +++ b/tests/benchmarks/dbus/CMakeLists.txt @@ -1,4 +1,5 @@ -# Generated from dbus.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause add_subdirectory(qdbustype) if(QT_FEATURE_process) diff --git a/tests/benchmarks/dbus/dbus.pro b/tests/benchmarks/dbus/dbus.pro deleted file mode 100644 index 1254ad95e9..0000000000 --- a/tests/benchmarks/dbus/dbus.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = \ - qdbustype - -qtConfig(process): SUBDIRS += \ - qdbusperformance diff --git a/tests/benchmarks/dbus/qdbusperformance/CMakeLists.txt b/tests/benchmarks/dbus/qdbusperformance/CMakeLists.txt index 5d79f36090..4f070d26e4 100644 --- a/tests/benchmarks/dbus/qdbusperformance/CMakeLists.txt +++ b/tests/benchmarks/dbus/qdbusperformance/CMakeLists.txt @@ -1,4 +1,5 @@ -# Generated from qdbusperformance.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause add_subdirectory(server) add_subdirectory(test) diff --git a/tests/benchmarks/dbus/qdbusperformance/qdbusperformance.pro b/tests/benchmarks/dbus/qdbusperformance/qdbusperformance.pro deleted file mode 100644 index 94cb8e41c7..0000000000 --- a/tests/benchmarks/dbus/qdbusperformance/qdbusperformance.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = subdirs -test.depends = server -SUBDIRS = server test diff --git a/tests/benchmarks/dbus/qdbusperformance/server/CMakeLists.txt b/tests/benchmarks/dbus/qdbusperformance/server/CMakeLists.txt index ff4612d042..7136a2e571 100644 --- a/tests/benchmarks/dbus/qdbusperformance/server/CMakeLists.txt +++ b/tests/benchmarks/dbus/qdbusperformance/server/CMakeLists.txt @@ -1,15 +1,16 @@ -# Generated from server.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## server Binary: ##################################################################### -qt_internal_add_benchmark(server +qt_internal_add_executable(server GUI - OUTPUT_DIRECTORY "." + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES ../serverobject.h server.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::DBus ) diff --git a/tests/benchmarks/dbus/qdbusperformance/server/server.cpp b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp index 6f0bca8bb1..5bf4ac1ec3 100644 --- a/tests/benchmarks/dbus/qdbusperformance/server/server.cpp +++ b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp @@ -1,32 +1,7 @@ -/**************************************************************************** -** -** 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/QtCore> -#include <QtDBus/QtDBus> + #include "../serverobject.h" diff --git a/tests/benchmarks/dbus/qdbusperformance/server/server.pro b/tests/benchmarks/dbus/qdbusperformance/server/server.pro deleted file mode 100644 index a2270ad2c1..0000000000 --- a/tests/benchmarks/dbus/qdbusperformance/server/server.pro +++ /dev/null @@ -1,6 +0,0 @@ -SOURCES = server.cpp -HEADERS = ../serverobject.h -TARGET = server -DESTDIR = . -QT += dbus -QT -= gui diff --git a/tests/benchmarks/dbus/qdbusperformance/serverobject.h b/tests/benchmarks/dbus/qdbusperformance/serverobject.h index f3c2d96f02..da12a56308 100644 --- a/tests/benchmarks/dbus/qdbusperformance/serverobject.h +++ b/tests/benchmarks/dbus/qdbusperformance/serverobject.h @@ -1,37 +1,13 @@ -/**************************************************************************** -** -** 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 SERVEROBJECT_H #define SERVEROBJECT_H #include <QObject> -#include <QtDBus/QtDBus> +#include <QDBusConnection> +#include <QDBusVariant> class ServerObject: public QObject { @@ -69,13 +45,12 @@ public slots: int size(const QDBusVariant &data) { QVariant v = data.variant(); - switch (v.type()) - { - case QVariant::ByteArray: + switch (v.typeId()) { + case QMetaType::QByteArray: return v.toByteArray().size(); - case QVariant::StringList: + case QMetaType::QStringList: return v.toStringList().size(); - case QVariant::String: + case QMetaType::QString: default: return v.toString().size(); } diff --git a/tests/benchmarks/dbus/qdbusperformance/test/CMakeLists.txt b/tests/benchmarks/dbus/qdbusperformance/test/CMakeLists.txt index 6b22096b4d..d62ab282a8 100644 --- a/tests/benchmarks/dbus/qdbusperformance/test/CMakeLists.txt +++ b/tests/benchmarks/dbus/qdbusperformance/test/CMakeLists.txt @@ -1,4 +1,5 @@ -# Generated from test.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qdbusperformance Binary: @@ -8,7 +9,7 @@ qt_internal_add_benchmark(tst_qdbusperformance SOURCES ../serverobject.h ../tst_qdbusperformance.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::DBus Qt::Test ) diff --git a/tests/benchmarks/dbus/qdbusperformance/test/test.pro b/tests/benchmarks/dbus/qdbusperformance/test/test.pro deleted file mode 100644 index ddc5410759..0000000000 --- a/tests/benchmarks/dbus/qdbusperformance/test/test.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES += ../tst_qdbusperformance.cpp -HEADERS += ../serverobject.h -TARGET = ../tst_qdbusperformance - -QT = core dbus testlib diff --git a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp index 39c9129456..7f1957b87f 100644 --- a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp +++ b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp @@ -1,33 +1,12 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ -#include <QtCore/QtCore> -#include <QtTest/QtTest> -#include <QtDBus/QtDBus> +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QTest> +#include <QTestEventLoop> +#include <QProcess> +#include <QDBusServiceWatcher> +#include <QDBusConnectionInterface> +#include <QDBusInterface> #include "./serverobject.h" @@ -79,7 +58,7 @@ void tst_QDBusPerformance::initTestCase() #else # define EXE "" #endif - proc.start(QFINDTESTDATA("server/server" EXE)); + proc.start(QFINDTESTDATA("../server/server" EXE)); QVERIFY2(proc.waitForStarted(), qPrintable(proc.errorString())); QVERIFY(proc.waitForReadyRead()); diff --git a/tests/benchmarks/dbus/qdbustype/CMakeLists.txt b/tests/benchmarks/dbus/qdbustype/CMakeLists.txt index 13169cc0a0..79597c435c 100644 --- a/tests/benchmarks/dbus/qdbustype/CMakeLists.txt +++ b/tests/benchmarks/dbus/qdbustype/CMakeLists.txt @@ -1,4 +1,5 @@ -# Generated from qdbustype.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_bench_qdbustype Binary: @@ -7,7 +8,7 @@ qt_internal_add_benchmark(tst_bench_qdbustype SOURCES main.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::DBusPrivate Qt::Test @@ -19,7 +20,7 @@ qt_internal_add_benchmark(tst_bench_qdbustype qt_internal_extend_target(tst_bench_qdbustype CONDITION QT_FEATURE_dbus_linked DEFINES QT_LINKED_LIBDBUS - PUBLIC_LIBRARIES + LIBRARIES dbus-1 ) diff --git a/tests/benchmarks/dbus/qdbustype/main.cpp b/tests/benchmarks/dbus/qdbustype/main.cpp index 0a07867ccb..d3ee0da14c 100644 --- a/tests/benchmarks/dbus/qdbustype/main.cpp +++ b/tests/benchmarks/dbus/qdbustype/main.cpp @@ -1,32 +1,7 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO module 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 <QtTest/QtTest> +#include <QTest> #include <QtCore/QCoreApplication> #include <QtDBus/private/qdbusutil_p.h> diff --git a/tests/benchmarks/dbus/qdbustype/qdbustype.pro b/tests/benchmarks/dbus/qdbustype/qdbustype.pro deleted file mode 100644 index 70f803f56f..0000000000 --- a/tests/benchmarks/dbus/qdbustype/qdbustype.pro +++ /dev/null @@ -1,11 +0,0 @@ -TARGET = tst_bench_qdbustype -QT -= gui -QT += core-private dbus-private testlib -qtConfig(dbus-linked) { - DEFINES += QT_LINKED_LIBDBUS - QMAKE_USE += dbus -} else { - SOURCES += ../../../../src/dbus/qdbus_symbols.cpp -} - -SOURCES += main.cpp |