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>
This commit is contained in:
Kurt Korbatits 2012-01-16 10:52:49 +10:00 committed by Qt by Nokia
parent 2ba0d1e550
commit 7beeb932fd

View File

@ -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";