Make sure that tests run with just compiled versions of tools
authorSandro Knauß <bugs@sandroknauss.de>
Wed, 24 Jun 2020 08:23:21 +0000 (09:23 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Wed, 24 Jun 2020 08:23:21 +0000 (09:23 +0100)
Origin: Debian
Last-Update: 2019-04-19

Last-Update: 2019-04-19
Gbp-Pq: Name fix_test_remove_qlibraryinfo.patch

17 files changed:
.qmake.conf
tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp
tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
tests/auto/qml/qmllint/tst_qmllint.cpp
tests/auto/qml/qmlmin/tst_qmlmin.cpp
tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
tests/auto/quick/examples/tst_examples.cpp

index 4b9929245c67c78fce6996aaa7882382610b9224..41014a0c7be1ce6d95c0814b545eddc06b94ad43 100644 (file)
@@ -1,6 +1,9 @@
 load(qt_build_config)
 CONFIG += warning_clean
 
+QMAKE_CXXFLAGS += -DTESTBINDIR=\\\"$$PWD/bin\\\"
+QMAKE_CXXFLAGS += -DTESTEXAMPLEDIR=\\\"$$PWD/examples\\\"
+
 DEFINES += QT_NO_LINKED_LIST
 DEFINES += QT_NO_JAVA_STYLE_ITERATORS
 
index d2cfd3897a9167c5f6b681c94a5d1ba81bfe47f6..b37a1d5f8efcec6bda23fb956945ee3f44a13aff 100644 (file)
@@ -136,7 +136,7 @@ QList<QQmlDebugClient *> 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);
index 37118f4bd094d267e9d662b1511b3f29d96e9450..866cb9a3f9fcb91bd2ff29cf286489ea45b30365 100644 (file)
@@ -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")
index 5b6c43bc0ca0abf64162f46e220174054d9439c6..f9598c4bc23f67407f9e8c6437fccff578db2e6d 100644 (file)
@@ -178,7 +178,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(),
@@ -471,7 +471,7 @@ void tst_QQmlDebugJS::setBreakpointInJavaScript()
 
     if (seedCache) { // Make sure there is a qmlc file that the engine should _not_ laod.
         QProcess process;
-        process.start(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene",
+        process.start(QStringLiteral(TESTBINDIR "/qmlscene"),
                       { testFile(QUITINJS_QMLFILE) });
         QTRY_COMPARE(process.state(), QProcess::NotRunning);
     }
@@ -853,8 +853,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 QV4DebugClient(m_connection);
     QScopedPointer<QQmlEngineDebugClient> engineClient(new QQmlEngineDebugClient(m_connection));
     m_process->start(QStringList() << QLatin1String(BLOCKMODE) << testFile(ONCOMPLETED_QMLFILE));
index 35579403865b60305291179ca3ae434e69e37b63..66e70275acc9a3383622f23e9b223508d12d3f82 100644 (file)
@@ -106,8 +106,7 @@ void tst_QQmlDebugService::checkPortRange()
 {
     QScopedPointer<QQmlDebugConnection> connection1(new QQmlDebugConnection());
     QScopedPointer<QQmlDebugProcess> 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<QQmlDebugConnection> connection2(new QQmlDebugConnection());
     QScopedPointer<QQmlDebugProcess> 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"));
index a8c43b1c75bc353ee19c4d6053145bfec348546e..68fa18ecdd64f73422f508ff06891962e51a8855 100644 (file)
@@ -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);
 }
index 980e2be1f1ff1efe21cc42b7a65090cb677bb9ff..df1c2d8578475b1c5ab44ae3312900e5191821b6 100644 (file)
@@ -88,7 +88,7 @@ QQmlEngineDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRoot
 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);
 }
index 6685558bb560d66049bd8d0a5ee7d487576fe7f4..7df0414b80d5c848d0a2bac01661965195cf5fc7 100644 (file)
@@ -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);
 }
index f08f3c1da747d28a5ace78dfee7a451b0f5b44cc..586a0e565197994e578c8f88bb08fdc27aece125 100644 (file)
@@ -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);
 }
 
index 085eb7b87a766fd7f485cedbb39a19b797bd2595..ca26c8b1cee976ced4b747da2158466eb6bddae0 100644 (file)
@@ -203,8 +203,7 @@ private:
 
     ConnectResult connect(bool block, const QString &file, 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();
index 4a1f5378a63b50bfc4a38596345eab4caf522d50..be1fa89b13f9563c8483cac047e81bab6fdce121 100644 (file)
@@ -104,7 +104,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())
index 582f146dca13cdb323089af26d2a5d7137dabc41..554959461c51eb16b72ecda5af54f4b0de03df3e 100644 (file)
@@ -51,7 +51,7 @@ private:
 void TestQmllint::initTestCase()
 {
     QQmlDataTest::initTestCase();
-    m_qmllintPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmllint");
+    m_qmllintPath = QLatin1String(TESTBINDIR "/qmllint");
 #ifdef Q_OS_WIN
     m_qmllintPath += QLatin1String(".exe");
 #endif
@@ -78,7 +78,7 @@ void TestQmllint::test_data()
 
 void TestQmllint::testUnqualified()
 {
-    auto qmlImportDir = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+    auto qmlImportDir = QString::fromUtf8(qgetenv("QML2_IMPORT_PATH"));
     QFETCH(QString, filename);
     QFETCH(QString, warningMessage);
     QFETCH(int, warningLine);
@@ -122,7 +122,7 @@ void TestQmllint::testUnqualified_data()
 
 void TestQmllint::testUnqualifiedNoSpuriousParentWarning()
 {
-    auto qmlImportDir = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+    auto qmlImportDir = QString::fromUtf8(qgetenv("QML2_IMPORT_PATH"));
     {
         QString filename = testFile("spuriousParentWarning.qml");
         QStringList args;
@@ -147,7 +147,7 @@ void TestQmllint::testUnqualifiedNoSpuriousParentWarning()
 
 void TestQmllint::catchIdentifierNoFalsePositive()
 {
-    auto qmlImportDir = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+    auto qmlImportDir = QString::fromUtf8(qgetenv("QML2_IMPORT_PATH"));
     QString filename = QLatin1String("catchIdentifierNoWarning.qml");
     filename.prepend(QStringLiteral("data/"));
     QStringList args;
index e244369581ffa7ff8b04de49eb6cfefb18634c2c..ab4da822f5cad010aee4c9423fe3cecf6562e94d 100644 (file)
@@ -65,7 +65,7 @@ tst_qmlmin::tst_qmlmin()
 void tst_qmlmin::initTestCase()
 {
 #if QT_CONFIG(process) && !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled
-    qmlminPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlmin");
+    qmlminPath = QStringLiteral(TESTBINDIR "/qmlmin");
 #ifdef Q_OS_WIN
     qmlminPath += QLatin1String(".exe");
 #endif
index 72356a4d84b2dc1b3fd7b0042e0920f6c369d06a..7e6f089597e28cbcde6585d71de9b1bad4aaade8 100644 (file)
@@ -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");
index 26232ac1a3cbe8d713d7167c4427bd7bae2af290..752e5c175cbea2509a299a2e258e0c8b3bf369cf 100644 (file)
@@ -9214,7 +9214,7 @@ void tst_qqmlecmascript::hugeStack()
 
 void tst_qqmlecmascript::gcCrashRegressionTest()
 {
-    const QString qmljs = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmljs";
+    const QString qmljs = QStringLiteral(TESTBINDIR "/qmljs");
     if (!QFile::exists(qmljs)) {
         QSKIP("Tets requires qmljs");
     }
index 5dd8e9dcc0a861fa347257594e9ae7c4ecdf4f6b..c84ace29445d94375def0c6095077265b117f2f0 100644 (file)
@@ -62,7 +62,7 @@ void tst_QV4Assembler::perfMapFile()
 #if !defined(Q_OS_LINUX) || defined(Q_OS_ANDROID)
     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;
index fdefa855e4011ee40b9dba140bab482ccbeffd26..cd77427be76a415b28d56013ae3429db6070b210 100644 (file)
@@ -167,8 +167,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);