File: fix_test_remove_qlibraryinfo.patch

package info (click to toggle)
qtdeclarative-opensource-src 5.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 88,360 kB
  • ctags: 56,741
  • sloc: cpp: 388,287; xml: 8,608; ansic: 2,554; python: 940; sh: 659; makefile: 57; perl: 50; php: 27
file content (170 lines) | stat: -rw-r--r-- 8,222 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
Description: Make sure that tests run with just compiled versions of tools
Author: Sandro Knauß <bugs@sandroknauss.de>
Origin: Debian
Last-Update: 2016-09-16
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp
+++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
@@ -62,7 +62,7 @@
 
 void tst_qmlmin::initTestCase()
 {
-    qmlminPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlmin");
+    qmlminPath = QString(TESTBINDIR) + QLatin1String("/qmlmin");
 #ifdef Q_OS_WIN
     qmlminPath += QLatin1String(".exe");
 #endif
--- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
+++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
@@ -177,7 +177,7 @@
 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));
--- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
+++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp
@@ -87,7 +87,7 @@
     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);
@@ -174,7 +174,7 @@
 
     connection = new QQmlDebugConnection();
     QList<QQmlDebugClient *> clients = QQmlDebugTest::createOtherClients(connection);
-    process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene",
+    process = new QQmlDebugProcess(TESTBINDIR "/qmlscene",
                                    this);
     process->setMaximumBindErrors(1);
     process->start(QStringList()
--- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
@@ -106,7 +106,7 @@
 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"));
 
@@ -120,7 +120,7 @@
 
     // 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"));
 
--- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
+++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp
@@ -94,7 +94,7 @@
 
 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)
--- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
+++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
@@ -73,8 +73,7 @@
             .arg(STR_PORT_FROM).arg(STR_PORT_TO)
             .arg(restrictServices ? QStringLiteral(",services:QmlInspector") : QString());
 
-    m_process.reset(new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) +
-                                         "/qml"));
+    m_process.reset(new QQmlDebugProcess(TESTBINDIR "/qml"));
     // Make sure the animation timing is exact
     m_process->addEnvironment(QLatin1String("QSG_RENDER_LOOP=basic"));
     m_process->start(QStringList() << argument << testFile(qmlFile));
--- 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.7.1
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
@@ -106,7 +106,7 @@
             .arg(restrictServices ? QStringLiteral(",services:QmlDebugger,QmlInspector") :
                                     QString());
 
-    m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml",
+    m_process = new QQmlDebugProcess(TESTBINDIR "/qml",
                                      this);
     m_process->start(QStringList() << argument << testFile("qtquick2.qml"));
     QVERIFY2(m_process->waitForSessionStart(),
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -297,7 +297,7 @@
 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)
--- a/tests/auto/qml/qmllint/main.cpp
+++ b/tests/auto/qml/qmllint/main.cpp
@@ -44,7 +44,7 @@
 
 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
--- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
+++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
@@ -54,7 +54,7 @@
 
 void tst_qmlplugindump::initTestCase()
 {
-    qmlplugindumpPath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
+    qmlplugindumpPath = QLatin1String(TESTBINDIR);
 
 #if defined(Q_OS_WIN)
     qmlplugindumpPath += QLatin1String("/qmlplugindump.exe");
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -169,8 +169,8 @@
 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);
--- a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -780,8 +780,7 @@
 {
     connection = new QQmlDebugConnection();
     if (qmlscene)
-        process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) +
-                                       "/qmlscene", this);
+        process = new QQmlDebugProcess(TESTBINDIR "/qmlscene", this);
     else
         process = new QQmlDebugProcess(QCoreApplication::applicationDirPath() +
                                        QLatin1String("/qqmldebugjsserver"), this);