summaryrefslogtreecommitdiffstats
path: root/patches/0082-Fixed-uic3-test-by-adding-extra-bin-dir-to-the-PATH.patch
blob: 31b9bbcffeb52a066861c53638d4c2225a36c568 (plain)
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
From c79c2a5e55d92951f6166cc1cae0ee8cece101b3 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Mon, 7 Mar 2011 09:55:41 +0100
Subject: [PATCH] Fixed uic3 test by adding extra bin/ dir to the PATH.

---
 qt3support/tests/auto/uic3/tst_uic3.cpp |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/qt3support/tests/auto/uic3/tst_uic3.cpp b/qt3support/tests/auto/uic3/tst_uic3.cpp
index d9ab0db..d4e30e6 100644
--- a/qt3support/tests/auto/uic3/tst_uic3.cpp
+++ b/qt3support/tests/auto/uic3/tst_uic3.cpp
@@ -73,17 +73,26 @@ private:
 
 tst_uic3::tst_uic3()
     : uic3Exists(true)
-    , command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic3"))
+    , command(QLatin1String("uic3"))
 {
 }
 
 void tst_uic3::initTestCase()
 {
+    // Append the bin/ dir to the path, in order to find uic3.
+#ifdef Q_OS_WIN
+    const QString sep = ";";
+#else
+    const QString sep = ":";
+#endif
+    QString path = QString::fromLocal8Bit(qgetenv("PATH"));
+    path = QDir::cleanPath(QDir::currentPath() + "/../../../bin") + sep + path;
+    qputenv("PATH", path.toLocal8Bit());
+
     QProcess process;
     process.start(command, QStringList(QLatin1String("-help")));
     if (!process.waitForFinished()) {
         uic3Exists = false;
-        const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
         QString message = QString::fromLatin1("'%1' could not be found when run from '%2'. Path: '%3' ").
                           arg(command, QDir::currentPath(), path);
         QFAIL(qPrintable(message));
-- 
1.7.2.2