Fix qdbusperformance and qprocess benchmarks

The tests failed because they couldn't find the servers they needed to
run. The dbus server wasn't being built, due to mis-configured CMake
config; fixed dbus server CMake config. Once built, the servers werent
at the paths relative to the test binaries that were given in the test
source files, because the test binary was in the test/ sub-directory.
The dbus test just needed a ../ on its path; the qprocess one also
needed its path wrapped in QFINDTESTDATA(), and a ".exe" suffix on MS.

Task-number: QTBUG-91713
Change-Id: I5ace23a5815575bbf88ea88e0b16afc7b8ba6a08
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit bf99c2b62bc3bc2dc10ba8f98bea0496b2026801)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Edward Welbourne 2021-07-07 17:02:05 +02:00 committed by Qt Cherry-pick Bot
parent bb997f29be
commit 80e1f25f68
3 changed files with 12 additions and 6 deletions

View File

@ -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.
@ -40,10 +40,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));
QByteArray array;
array.resize(1024 * 1024);

View File

@ -4,9 +4,9 @@
## 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

View File

@ -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.
@ -83,7 +83,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());