diff options
author | João Abecasis <joao@abecasis.name> | 2009-03-19 13:36:56 +0100 |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-04-02 16:29:49 +0200 |
commit | 605746fd14ff68f19a806bb54882fb967fccc8e8 (patch) | |
tree | f4679f7e4ae9cf7df7846fc416623fcbf699705e /tests/auto/qmake/testcompiler.cpp | |
parent | 0d026b267badbf7890b02256826f0ff3821fcec7 (diff) | |
download | qt4-tools-605746fd14ff68f19a806bb54882fb967fccc8e8.tar.gz |
In qmake tests, allow child environment to be manipulated
... without having to change the parent process's environment.
Reviewed-by: mariusSO
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 b518da808e..122a2b8217 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; |