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.

Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-91713
Change-Id: I5ace23a5815575bbf88ea88e0b16afc7b8ba6a08
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Edward Welbourne 2021-07-07 17:02:05 +02:00
parent 90d9a86c2e
commit bf99c2b62b
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/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the test suite of the Qt Toolkit. ** This file is part of the test suite of the Qt Toolkit.
@ -40,10 +40,16 @@ private slots:
void echoTest_performance(); void echoTest_performance();
}; };
#ifdef Q_OS_WIN
# define EXE ".exe"
#else
# define EXE ""
#endif
void tst_QProcess::echoTest_performance() void tst_QProcess::echoTest_performance()
{ {
QProcess process; QProcess process;
process.start("testProcessLoopback/testProcessLoopback"); process.start(QFINDTESTDATA("../testProcessLoopback/testProcessLoopback" EXE));
QByteArray array; QByteArray array;
array.resize(1024 * 1024); array.resize(1024 * 1024);

View File

@ -4,9 +4,9 @@
## server Binary: ## server Binary:
##################################################################### #####################################################################
qt_internal_add_benchmark(server qt_internal_add_executable(server
GUI GUI
OUTPUT_DIRECTORY "." OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
SOURCES SOURCES
../serverobject.h ../serverobject.h
server.cpp 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/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the test suite of the Qt Toolkit. ** This file is part of the test suite of the Qt Toolkit.
@ -83,7 +83,7 @@ void tst_QDBusPerformance::initTestCase()
#else #else
# define EXE "" # define EXE ""
#endif #endif
proc.start(QFINDTESTDATA("server/server" EXE)); proc.start(QFINDTESTDATA("../server/server" EXE));
QVERIFY2(proc.waitForStarted(), qPrintable(proc.errorString())); QVERIFY2(proc.waitForStarted(), qPrintable(proc.errorString()));
QVERIFY(proc.waitForReadyRead()); QVERIFY(proc.waitForReadyRead());