diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-03-05 10:44:04 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-03-05 10:44:48 +0100 |
commit | d51abed57a8f677a0d4eac57fd3f16bd4662190a (patch) | |
tree | b3e173db4b72edbff6cb8dcc203c3d4526a1b51b /tests/auto/tools/qmake/testcompiler.cpp | |
parent | 07ae18f96e87a2db40ae014f28893f1080efa7ae (diff) | |
parent | 0862d7f78af978cf513097b3bdc33cd8096dee75 (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Change-Id: Ibcb1f7070f50968b77b66112750ce5c70fc0b6d0
Diffstat (limited to 'tests/auto/tools/qmake/testcompiler.cpp')
-rw-r--r-- | tests/auto/tools/qmake/testcompiler.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/auto/tools/qmake/testcompiler.cpp b/tests/auto/tools/qmake/testcompiler.cpp index 97c640b28f..4e5dc26eac 100644 --- a/tests/auto/tools/qmake/testcompiler.cpp +++ b/tests/auto/tools/qmake/testcompiler.cpp @@ -132,13 +132,34 @@ bool TestCompiler::errorOut() return false; } +// Return the system environment, remove MAKEFLAGS variable in +// case the CI uses jom passing flags incompatible to nmake +// or vice versa. +static inline QStringList systemEnvironment() +{ +#ifdef Q_OS_WIN + static QStringList result; + if (result.isEmpty()) { + foreach (const QString &variable, QProcess::systemEnvironment()) { + if (variable.startsWith(QStringLiteral("MAKEFLAGS="), Qt::CaseInsensitive)) { + qWarning("Removing environment setting '%s'", qPrintable(variable)); + } else { + result.push_back(variable); + } + } + } +#else + static const QStringList result = QProcess::systemEnvironment(); +#endif // ifdef Q_OS_WIN + return result; +} + bool TestCompiler::runCommand( QString cmdline, bool expectFail ) { testOutput_.append("Running command: " + cmdline); QProcess child; - if (!environment_.empty()) - child.setEnvironment(QProcess::systemEnvironment() + environment_); + child.setEnvironment(systemEnvironment() + environment_); child.start(cmdline); if (!child.waitForStarted(-1)) { |