Make sure that tests run with just compiled versions of tools
authorSandro Knauß <bugs@sandroknauss.de>
Sat, 8 Jul 2023 06:59:44 +0000 (07:59 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Sat, 8 Jul 2023 06:59:44 +0000 (07:59 +0100)
Origin: Debian
Last-Update: 2020-09-08

Last-Update: 2020-09-08
Gbp-Pq: Name fix_test_remove_qlibraryinfo.patch

19 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/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.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/qmlformat/tst_qmlformat.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 0d692629d36c0af28b8f5993b032dc4c07db5c44..83947193453314735517996859f5d57fce412f50 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 ec7ee15d3499372f8c84d6b49488ea0e148f432a..73fec02b92cb0dead292ed590db444a20b4ab7cd 100644 (file)
@@ -135,7 +135,7 @@ QList<QQmlDebugClient *> tst_QDebugMessageService::createClients()
 
 void tst_QDebugMessageService::retrieveDebugOutput()
 {
-    QCOMPARE(QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml",
+    QCOMPARE(QQmlDebugTest::connectTo(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 43c81ee515570e59f383b5f255a2e44d170257ca..5d0088c59ea087e17c4fda42c0e154f864237fc7 100644 (file)
@@ -184,7 +184,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::connectTo(
                 executable, restrictServices ? QStringLiteral("V8Debugger") : QString(),
@@ -477,7 +477,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);
     }
@@ -846,8 +846,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 01ee805deea4d068ee9532b6de79f50138452a04..7bb422ce362077f7fb532d2bc7ef5c5db408487d 100644 (file)
@@ -66,7 +66,7 @@ QList<QQmlDebugClient *> tst_QQmlDebugTranslationService::createClients()
 
 void tst_QQmlDebugTranslationService::pluginConnection()
 {
-    auto executable = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml";
+    auto executable = QStringLiteral(TESTBINDIR "/qml");
     auto services = "DebugTranslation";
     auto extraArgs = testFile(QMLFILE);
     auto block = true;
index c8915fb84096e10c652f6cfb325274a335dcc59a..9b574bcf40d9953ff4f3aaa8af546af92ff0ff6f 100644 (file)
@@ -82,7 +82,7 @@ private slots:
 QQmlDebugTest::ConnectResult tst_QQmlEngineControl::connectTo(const QString &file,
                                                             bool restrictServices)
 {
-    return QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene",
+    return QQmlDebugTest::connectTo(TESTBINDIR "/qmlscene",
                                   restrictServices ? QStringLiteral("EngineControl") : QString(),
                                   testFile(file), true);
 }
index 9830f1a9bdafee8293f24a655d70bd344975343e..eedf90472606d315f4263d4514515df6ad61e7a3 100644 (file)
@@ -88,7 +88,7 @@ QQmlEngineDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRoot
 QQmlDebugTest::ConnectResult tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices)
 {
     return QQmlDebugTest::connectTo(
-                QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml",
+                TESTBINDIR "/qml",
                 restrictServices ? QStringLiteral("QmlDebugger,QmlInspector") : QString(),
                 testFile("qtquick2.qml"), true);
 }
index b5f45f1eebf6f1cdce63492917aef7b29be3428b..f03fd82f681f39068130f9b96031dc88e1a30a26 100644 (file)
@@ -64,7 +64,7 @@ private slots:
 QQmlDebugTest::ConnectResult tst_QQmlInspector::startQmlProcess(const QString &qmlFile,
                                                                 bool restrictServices)
 {
-    return QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml",
+    return QQmlDebugTest::connectTo(TESTBINDIR "/qml",
                                   restrictServices ? QStringLiteral("QmlInspector") : QString(),
                                   testFile(qmlFile), true);
 }
index 2de525db542469f0b78d013f44eee7a841c63fe8..dd7bb51df8bc1782abfbd33a47383aecf780a49b 100644 (file)
@@ -74,7 +74,7 @@ private slots:
 
 QQmlDebugTest::ConnectResult tst_QQmlPreview::startQmlProcess(const QString &qmlFile)
 {
-    return QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml",
+    return QQmlDebugTest::connectTo(QStringLiteral(TESTBINDIR "/qml"),
                                   QStringLiteral("QmlPreview"), testFile(qmlFile), true);
 }
 
index c2a774b42db0528d7593f969728af29650b4d2fd..c8a7d77b85e66172d7a08eaa620fb58231f34a74 100644 (file)
@@ -203,8 +203,7 @@ private:
 
     ConnectResult connectTo(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 65137c65a26ff8aa328f0deea21688d7b38fd4a4..2bda5ab92ebdb9810033b15ee2d0d63b81f46611 100644 (file)
@@ -110,7 +110,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 413dc5f8a511e7e7b6c1d39c57dbad203133f3b6..6f4ac1ff47d1f3d4c296db8b13da1e5f1aee0197 100644 (file)
@@ -84,7 +84,7 @@ private:
 void TestQmlformat::initTestCase()
 {
     QQmlDataTest::initTestCase();
-    m_qmlformatPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlformat");
+    m_qmlformatPath = QStringLiteral(TESTBINDIR "/qmlformat");
 #ifdef Q_OS_WIN
     m_qmlformatPath += QLatin1String(".exe");
 #endif
index 8697495a6f0ce9fd637fd4293d66e2e2e89465cf..a538d79dc9a1394770e58cb345038cce6a354a5f 100644 (file)
@@ -59,7 +59,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
@@ -214,7 +214,7 @@ void TestQmllint::cleanQmlCode()
 
 QString TestQmllint::runQmllint(const QString &fileToLint, bool shouldSucceed)
 {
-    auto qmlImportDir = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+    auto qmlImportDir = QString::fromUtf8(qgetenv("QML2_IMPORT_PATH"));
     QStringList args;
     args << QStringLiteral("-U") << testFile(fileToLint)
          << QStringLiteral("-I") << qmlImportDir
index cc028d979f5888b4ce7b6bd345a0798f7ac7e6ba..7c7fd95262b97732112e81d3b60b9084648e2355 100644 (file)
@@ -68,7 +68,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 2291c3189574179e14e84408cd521dcf76a86ad6..bc7551798a27f95b3c9a38d82674fd7a015a0e3e 100644 (file)
@@ -9290,7 +9290,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 5d9be077fe0aefc8bb0cc34b26a5396fe946fa9b..cd148818f324a427f0c89647ea0c1748e4f05c90 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);