From aeb4f2cb3b0d0d77fbf232c081dda37975cb2b25 Mon Sep 17 00:00:00 2001 From: Debian Qt/KDE Maintainers Date: Mon, 21 Oct 2019 18:12:14 +0100 Subject: [PATCH] fix_test_remove_qlibraryinfo Gbp-Pq: Name fix_test_remove_qlibraryinfo.patch --- .qmake.conf | 3 +++ .../qdebugmessageservice/tst_qdebugmessageservice.cpp | 2 +- .../qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp | 3 +-- tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 5 ++--- .../qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp | 6 ++---- .../debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp | 2 +- .../tst_qqmlenginedebuginspectorintegration.cpp | 2 +- tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp | 2 +- tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp | 2 +- .../qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 3 +-- tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 2 +- tests/auto/qml/qmllint/main.cpp | 2 +- tests/auto/qml/qmlmin/tst_qmlmin.cpp | 2 +- tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp | 2 +- tests/auto/qml/qv4assembler/tst_qv4assembler.cpp | 2 +- tests/auto/quick/examples/tst_examples.cpp | 4 ++-- 16 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.qmake.conf b/.qmake.conf index d42b39c2e..361ad964e 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,4 +1,7 @@ load(qt_build_config) CONFIG += warning_clean +QMAKE_CXXFLAGS += -DTESTBINDIR=\\\"$$PWD/bin\\\" +QMAKE_CXXFLAGS += -DTESTEXAMPLEDIR=\\\"$$PWD/examples\\\" + MODULE_VERSION = 5.12.5 diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index d2cfd3897..b37a1d5f8 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -136,7 +136,7 @@ QList tst_QDebugMessageService::createClients() void tst_QDebugMessageService::retrieveDebugOutput() { - QCOMPARE(QQmlDebugTest::connect(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + QCOMPARE(QQmlDebugTest::connect(TESTBINDIR "/qml", QString(), testFile(QMLFILE), true), ConnectSuccess); QTRY_VERIFY(m_client->logBuffer.size() >= 2); diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp index 37118f4bd..866cb9a3f 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp @@ -102,8 +102,7 @@ void tst_QQmlDebuggingEnabler::qmlscene() QFETCH(bool, blockMode); QFETCH(QStringList, services); - m_process = new QQmlDebugProcess( - QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + m_process = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this); m_process->setMaximumBindErrors(1); m_process->start(QStringList() << QString::fromLatin1("-qmljsdebugger=connector:%1%2%3%4") diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index 1202cddc0..341a1028e 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -800,7 +800,7 @@ QQmlDebugTest::ConnectResult tst_QQmlDebugJS::init(bool qmlscene, const QString bool blockMode, bool restrictServices) { const QString executable = qmlscene - ? QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene" + ? TESTBINDIR "/qmlscene" : debugJsServerPath("qqmldebugjs"); return QQmlDebugTest::connect( executable, restrictServices ? QStringLiteral("V8Debugger") : QString(), @@ -1472,8 +1472,7 @@ void tst_QQmlDebugJS::evaluateInLocalScope() void tst_QQmlDebugJS::evaluateInContext() { m_connection = new QQmlDebugConnection(); - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) - + "/qmlscene", this); + m_process = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this); m_client = new QJSDebugClient(m_connection); QScopedPointer engineClient(new QQmlEngineDebugClient(m_connection)); m_process->start(QStringList() << QLatin1String(BLOCKMODE) << testFile(ONCOMPLETED_QMLFILE)); diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp index 355794038..66e70275a 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp @@ -106,8 +106,7 @@ void tst_QQmlDebugService::checkPortRange() { QScopedPointer connection1(new QQmlDebugConnection()); QScopedPointer process1( - new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) - + "/qmlscene", this)); + new QQmlDebugProcess(TESTBINDIR "/qmlscene", this)); process1->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") << testFile("test.qml")); @@ -123,8 +122,7 @@ void tst_QQmlDebugService::checkPortRange() // Second instance QScopedPointer connection2(new QQmlDebugConnection()); QScopedPointer process2( - new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) - + "/qmlscene", this)); + new QQmlDebugProcess(TESTBINDIR "/qmlscene", this)); process2->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") << testFile("test.qml")); diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp index a8c43b1c7..68fa18ecd 100644 --- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp +++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp @@ -82,7 +82,7 @@ private slots: QQmlDebugTest::ConnectResult tst_QQmlEngineControl::connect(const QString &file, bool restrictServices) { - return QQmlDebugTest::connect(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", + return QQmlDebugTest::connect(TESTBINDIR "/qmlscene", restrictServices ? QStringLiteral("EngineControl") : QString(), testFile(file), true); } diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 249416a3b..0b759c870 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -88,7 +88,7 @@ QmlDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRootObject( QQmlDebugTest::ConnectResult tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices) { return QQmlDebugTest::connect( - QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + TESTBINDIR "/qml", restrictServices ? QStringLiteral("QmlDebugger,QmlInspector") : QString(), testFile("qtquick2.qml"), true); } diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index 5c9506eb2..90cc4dfc1 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -64,7 +64,7 @@ private slots: QQmlDebugTest::ConnectResult tst_QQmlInspector::startQmlProcess(const QString &qmlFile, bool restrictServices) { - return QQmlDebugTest::connect(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + return QQmlDebugTest::connect(TESTBINDIR "/qml", restrictServices ? QStringLiteral("QmlInspector") : QString(), testFile(qmlFile), true); } diff --git a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp index f08f3c1da..586a0e565 100644 --- a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp +++ b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp @@ -74,7 +74,7 @@ private slots: QQmlDebugTest::ConnectResult tst_QQmlPreview::startQmlProcess(const QString &qmlFile) { - return QQmlDebugTest::connect(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + return QQmlDebugTest::connect(QStringLiteral(TESTBINDIR "/qml"), QStringLiteral("QmlPreview"), testFile(qmlFile), true); } diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index e0bd5413f..4f1b37993 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -203,8 +203,7 @@ private: ConnectResult connect(bool block, const QString &testFile, bool recordFromStart = true, uint flushInterval = 0, bool restrictServices = true, - const QString &executable - = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + const QString &executable = QStringLiteral(TESTBINDIR "/qmlscene")); void checkProcessTerminated(); void checkTraceReceived(); void checkJsHeap(); diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index e290f2198..25e57d1d4 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -99,7 +99,7 @@ static bool generateCache(const QString &qmlFileName, QByteArray *capturedStderr QProcess proc; if (capturedStderr == nullptr) proc.setProcessChannelMode(QProcess::ForwardedChannels); - proc.setProgram(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator() + QLatin1String("qmlcachegen")); + proc.setProgram(TESTBINDIR "/qmlcachegen"); proc.setArguments(QStringList() << qmlFileName); proc.start(); if (!proc.waitForFinished()) diff --git a/tests/auto/qml/qmllint/main.cpp b/tests/auto/qml/qmllint/main.cpp index eedbd7c2f..1e4b6e2fa 100644 --- a/tests/auto/qml/qmllint/main.cpp +++ b/tests/auto/qml/qmllint/main.cpp @@ -44,7 +44,7 @@ private: void TestQmllint::initTestCase() { - m_qmllintPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmllint"); + m_qmllintPath = QLatin1String(TESTBINDIR "/qmllint"); #ifdef Q_OS_WIN m_qmllintPath += QLatin1String(".exe"); #endif diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp index d1e74aece..125dc0de2 100644 --- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp +++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp @@ -64,7 +64,7 @@ tst_qmlmin::tst_qmlmin() void tst_qmlmin::initTestCase() { - qmlminPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlmin"); + qmlminPath = QStringLiteral(TESTBINDIR "/qmlmin"); #ifdef Q_OS_WIN qmlminPath += QLatin1String(".exe"); #endif diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp index 72356a4d8..7e6f08959 100644 --- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp +++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp @@ -62,7 +62,7 @@ tst_qmlplugindump::tst_qmlplugindump() void tst_qmlplugindump::initTestCase() { QQmlDataTest::initTestCase(); - qmlplugindumpPath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + qmlplugindumpPath = QLatin1String(TESTBINDIR); #if defined(Q_OS_WIN) qmlplugindumpPath += QLatin1String("/qmlplugindump.exe"); diff --git a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp index afc00ec72..110a496a0 100644 --- a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp +++ b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp @@ -45,7 +45,7 @@ void tst_QV4Assembler::perfMapFile() #if !defined(Q_OS_LINUX) QSKIP("perf map files are only generated on linux"); #else - const QString qmljs = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmljs"; + const QString qmljs = QStringLiteral(TESTBINDIR "/qmljs"); QProcess process; QTemporaryFile infile; diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp index 9b3fa8fd2..213b2e118 100644 --- a/tests/auto/quick/examples/tst_examples.cpp +++ b/tests/auto/quick/examples/tst_examples.cpp @@ -166,8 +166,8 @@ void tst_examples::namingConvention(const QDir &d) void tst_examples::namingConvention() { QStringList examplesLocations; - examplesLocations << QLibraryInfo::location(QLibraryInfo::ExamplesPath) + QLatin1String("/qml"); - examplesLocations << QLibraryInfo::location(QLibraryInfo::ExamplesPath) + QLatin1String("/quick"); + examplesLocations << QLatin1String(TESTEXAMPLEDIR "/qml"); + examplesLocations << QLatin1String(TESTEXAMPLEDIR "/quick"); foreach(const QString &examples, examplesLocations) { QDir d(examples); -- 2.30.2