diff options
Diffstat (limited to 'tests/auto/qmake/testcompiler.cpp')
-rw-r--r-- | tests/auto/qmake/testcompiler.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp index b518da8..122a2b8 100644 --- a/tests/auto/qmake/testcompiler.cpp +++ b/tests/auto/qmake/testcompiler.cpp @@ -133,6 +133,9 @@ bool TestCompiler::runCommand( QString cmdline ) testOutput_.append("Running command: " + cmdline); QProcess child; + if (!environment_.empty()) + child.setEnvironment(QProcess::systemEnvironment() + environment_); + child.start(cmdline); if (!child.waitForStarted(-1)) { testOutput_.append( "Unable to start child process." ); @@ -166,6 +169,16 @@ void TestCompiler::setBaseCommands( QString makeCmd, QString qmakeCmd ) qmakeCmd_ = qmakeCmd; } +void TestCompiler::resetEnvironment() +{ + environment_.clear(); +} + +void TestCompiler::addToEnvironment( QString varAssignment ) +{ + environment_.push_back(varAssignment); +} + bool TestCompiler::makeClean( const QString &workPath ) { QDir D; |