From 43377754b396fb9cdac1932b3686452083b84c5a Mon Sep 17 00:00:00 2001 From: Debian Qt/KDE Maintainers Date: Fri, 7 Oct 2016 07:03:28 +0000 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 | 2 +- tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 2 +- .../qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp | 4 ++-- .../qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp | 2 +- .../tst_qqmlenginedebuginspectorintegration.cpp | 3 +-- tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp | 2 +- .../debugger/qqmlprofilerservice/tst_qqmlprofilerservice.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/quick/examples/tst_examples.cpp | 4 ++-- 13 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.qmake.conf b/.qmake.conf index 5c4271944..68a7d9bc0 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,7 @@ load(qt_build_config) CONFIG += qt_example_installs CONFIG += warning_clean +QMAKE_CXXFLAGS += -DTESTBINDIR=\\\"$$PWD/bin\\\" +QMAKE_CXXFLAGS += -DTESTEXAMPLEDIR=\\\"$$PWD/examples\\\" + MODULE_VERSION = 5.6.1 diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index d0801dd4e..c515d2e3c 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -171,7 +171,7 @@ void tst_QDebugMessageService::cleanupTestCase() void tst_QDebugMessageService::init() { m_connection = new QQmlDebugConnection(); - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", this); + m_process = new QQmlDebugProcess(TESTBINDIR "/qml", this); m_client = new QQmlDebugMsgClient(m_connection); m_process->start(QStringList() << QLatin1String(NORMALMODE) << QQmlDataTest::instance()->testFile(QMLFILE)); diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp index 98ef59031..55dd2da94 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp @@ -89,7 +89,7 @@ bool tst_QQmlDebuggingEnabler::init(bool blockMode, bool qmlscene, int portFrom, connection = new QQmlDebugConnection(); if (qmlscene) { - process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + process = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this); process->setMaximumBindErrors(1); } else { process = new QQmlDebugProcess(QCoreApplication::applicationDirPath() + QLatin1String("/qqmldebuggingenablerserver"), this); diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index 7dbe35807..18c2e7ed7 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -829,7 +829,7 @@ void tst_QQmlDebugJS::cleanupTestCase() void tst_QQmlDebugJS::init(const QString &qmlFile, bool blockMode, bool restrictServices) { connection = new QQmlDebugConnection(); - process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + process = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this); client = new QJSDebugClient(connection); const char *args = 0; diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp index b63c5c0a6..85adf1f74 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp @@ -99,7 +99,7 @@ void tst_QQmlDebugService::initTestCase() void tst_QQmlDebugService::checkPortRange() { QQmlDebugConnection *connection1 = new QQmlDebugConnection(); - QQmlDebugProcess *process1 = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + QQmlDebugProcess *process1 = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this); process1->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") << testFile("test.qml")); @@ -113,7 +113,7 @@ void tst_QQmlDebugService::checkPortRange() // Second instance QQmlDebugConnection *connection2 = new QQmlDebugConnection(); - QQmlDebugProcess *process2 = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + QQmlDebugProcess *process2 = 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 11fa56d71..6f31c16ba 100644 --- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp +++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp @@ -153,7 +153,7 @@ void QQmlEngineControlClient::messageReceived(const QByteArray &message) void tst_QQmlEngineControl::connect(const QString &testFile, bool restrictServices) { - const QString executable = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"; + const QString executable = TESTBINDIR "/qmlscene"; QStringList arguments; arguments << QString::fromLatin1("-qmljsdebugger=port:%1,%2,block%3") .arg(STR_PORT_FROM).arg(STR_PORT_TO) diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 0285bae18..e38157763 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -102,8 +102,7 @@ void tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices) QString()); // ### Still using qmlscene because of QTBUG-33376 - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) - + "/qmlscene", this); + m_process = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this); m_process->start(QStringList() << argument << testFile("qtquick2.qml")); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index 70833f5e2..4a1a565c9 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -84,7 +84,7 @@ void tst_QQmlInspector::startQmlsceneProcess(const char * /* qmlFile */, bool re .arg(restrictServices ? QStringLiteral(",services:QmlInspector") : QString()); // ### This should be using qml instead of qmlscene, but can't because of QTBUG-33376 (same as the XFAIL testcase) - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + m_process = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this); m_process->start(QStringList() << argument << testFile("qtquick2.qml")); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 0e63e1895..74eb84063 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -359,7 +359,7 @@ void QQmlProfilerClient::messageReceived(const QByteArray &message) void tst_QQmlProfilerService::connect(bool block, const QString &testFile, bool restrictServices) { // ### Still using qmlscene due to QTBUG-33377 - const QString executable = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"; + const QString executable = TESTBINDIR "/qmlscene"; QStringList arguments; arguments << QString::fromLatin1("-qmljsdebugger=port:%1,%2%3%4") .arg(STR_PORT_FROM).arg(STR_PORT_TO) diff --git a/tests/auto/qml/qmllint/main.cpp b/tests/auto/qml/qmllint/main.cpp index a6dadd717..767ab77fb 100644 --- a/tests/auto/qml/qmllint/main.cpp +++ b/tests/auto/qml/qmllint/main.cpp @@ -49,7 +49,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 6d2fba3f4..876e0aed1 100644 --- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp +++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp @@ -67,7 +67,7 @@ tst_qmlmin::tst_qmlmin() void tst_qmlmin::initTestCase() { - qmlminPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlmin"); + qmlminPath = QString(TESTBINDIR) + QLatin1String("/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 82506b421..1b8eaedf9 100644 --- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp +++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp @@ -59,7 +59,7 @@ tst_qmlplugindump::tst_qmlplugindump() void tst_qmlplugindump::initTestCase() { - qmlplugindumpPath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + qmlplugindumpPath = QLatin1String(TESTBINDIR); #if defined(Q_OS_WIN) qmlplugindumpPath += QLatin1String("/qmlplugindump.exe"); diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp index 20031c24d..b1acfad2e 100644 --- a/tests/auto/quick/examples/tst_examples.cpp +++ b/tests/auto/quick/examples/tst_examples.cpp @@ -174,8 +174,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