summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2012-01-16 10:52:49 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-17 04:53:35 +0100
commit7beeb932fd5cbe4e213a755001f784508a63572d (patch)
tree45b51dd1337b6036065444f1151224b69f1b1221 /tests/auto/corelib/tools
parent2ba0d1e550d5ec8624a4c6a52ff2ce48f9557cf0 (diff)
Changed qsharedpointer unittest to use build qmake over system one.
- If we can find the qmake belonging to the build, use that instead of qmake from the PATH for compiling subtests. Change-Id: I9445754bb02dab11c3e1bbe9dc459ecc682689a4 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
index c7ffe8cb7b..2e3dd0699d 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
@@ -52,6 +52,7 @@
#include <QtCore/QDirIterator>
#include <QtCore/QDateTime>
#include <QtCore/QDebug>
+#include <QtCore/QLibraryInfo>
#ifndef DEFAULT_MAKESPEC
# error DEFAULT_MAKESPEC not defined
@@ -565,7 +566,17 @@ namespace QTest {
<< makespec()
<< QLatin1String("project.pro");
qmake.setWorkingDirectory(temporaryDirPath);
- qmake.start(QLatin1String("qmake"), args);
+
+ QString cmd = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake";
+#ifdef Q_OS_WIN
+ cmd.append(".exe");
+#endif
+ if (!QFile::exists(cmd)) {
+ cmd = "qmake";
+ qWarning("qmake from build not found, fallback to PATH's qmake");
+ }
+
+ qmake.start(cmd, args);
std_out += "### --- stdout from qmake --- ###\n";
std_err += "### --- stderr from qmake --- ###\n";