summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-07-07 17:02:05 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-07-19 11:35:47 +0200
commita22c7d5644b83f1efc61756f91c788f7f48c8041 (patch)
treeac585f09e2c6ad69c28755253188f314fc72cf82 /tests
parent9665f80adae95f0bb0430329d97b74f8b38c3694 (diff)
Fix qdbusperformance and qprocess benchmarks
The tests failed on 5.15 for different reasons than they do on dev, so this cherry-pick is significantly modified. Only changes to qmake configuration (absent on dev) were needed, but this reworking includes such of the C++ code changes as are still a benefit, too. The 5.15 failures were due to mis-configuring qmake: the qprocess test's server was told it was a benchmark; the qdbusperformance benchmark didn't know that was what it was. Both tests called a QProcess::start() overload that was deprecated at 5.15 (even though the code still compiles just fine after removal of that overload at 6.0), so silence the warning by passing an empty QStringList(). Add the ".exe" suffix for QProcess's server path and apply QFINDTESTDATA() to it. Task-number: QTBUG-91713 Change-Id: I5ace23a5815575bbf88ea88e0b16afc7b8ba6a08 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit bf99c2b62bc3bc2dc10ba8f98bea0496b2026801) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro1
-rw-r--r--tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp10
-rw-r--r--tests/benchmarks/dbus/qdbusperformance/test/test.pro1
-rw-r--r--tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp4
4 files changed, 11 insertions, 5 deletions
diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro
index 1f56ad6ee6..89fea90d90 100644
--- a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro
+++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro
@@ -1,4 +1,3 @@
-CONFIG += benchmark
CONFIG -= qt
CONFIG += cmdline
winrt: QMAKE_LFLAGS += /ENTRY:mainCRTStartup
diff --git a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
index 1fd3b9d5da..6cf7529d55 100644
--- a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
+++ b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -39,10 +39,16 @@ private slots:
void echoTest_performance();
};
+#ifdef Q_OS_WIN
+# define EXE ".exe"
+#else
+# define EXE ""
+#endif
+
void tst_QProcess::echoTest_performance()
{
QProcess process;
- process.start("testProcessLoopback/testProcessLoopback");
+ process.start(QFINDTESTDATA("testProcessLoopback/testProcessLoopback" EXE), QStringList());
QByteArray array;
array.resize(1024 * 1024);
diff --git a/tests/benchmarks/dbus/qdbusperformance/test/test.pro b/tests/benchmarks/dbus/qdbusperformance/test/test.pro
index ddc5410759..faa2fe81ba 100644
--- a/tests/benchmarks/dbus/qdbusperformance/test/test.pro
+++ b/tests/benchmarks/dbus/qdbusperformance/test/test.pro
@@ -1,3 +1,4 @@
+CONFIG += benchmark
SOURCES += ../tst_qdbusperformance.cpp
HEADERS += ../serverobject.h
TARGET = ../tst_qdbusperformance
diff --git a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp
index 39c9129456..4bb71c4775 100644
--- a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp
+++ b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -79,7 +79,7 @@ void tst_QDBusPerformance::initTestCase()
#else
# define EXE ""
#endif
- proc.start(QFINDTESTDATA("server/server" EXE));
+ proc.start(QFINDTESTDATA("server/server" EXE), QStringList());
QVERIFY2(proc.waitForStarted(), qPrintable(proc.errorString()));
QVERIFY(proc.waitForReadyRead());