summaryrefslogtreecommitdiff
path: root/tests/auto/qmake/testcompiler.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-03-19 13:36:56 +0100
committerJoão Abecasis <joao@abecasis.name>2009-04-02 16:29:49 +0200
commit605746fd14ff68f19a806bb54882fb967fccc8e8 (patch)
treef4679f7e4ae9cf7df7846fc416623fcbf699705e /tests/auto/qmake/testcompiler.cpp
parent0d026b267badbf7890b02256826f0ff3821fcec7 (diff)
downloadqt4-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.cpp13
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;