summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2012-11-21 14:40:13 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2012-11-21 14:56:23 +0100
commit405d40b3207a7251532c615f73a721875b6e2e09 (patch)
tree0abfaf57c834ad5406dc7a3aea2182788f82fa48 /tests
parent092ec158dd746c8dc096a69a347caa2170f6312a (diff)
remove m_bResetJomProcessEnvironment member from test
Just clear the environment after every jom run. Change-Id: I9edc5e0fcf84cc6384e85f90b6a6290509197885 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.cpp13
-rw-r--r--tests/tests.h1
2 files changed, 4 insertions, 10 deletions
diff --git a/tests/tests.cpp b/tests/tests.cpp
index 44c3981..a082102 100644
--- a/tests/tests.cpp
+++ b/tests/tests.cpp
@@ -39,7 +39,6 @@ void ParserTest::initTestCase()
m_makefileFactory = new MakefileFactory;
m_preprocessor = 0;
m_jomProcess = new QProcess(this);
- m_bResetJomProcessEnvironment = false;
m_oldCurrentPath = QDir::currentPath();
QDir::setCurrent(SRCDIR "makefiles");
}
@@ -875,6 +874,9 @@ void ParserTest::windowsPathsInTargetName()
QCOMPARE(target->m_commands.count(), 2);
}
+/**
+ * Note: this function clears the environment of m_jomProcess after every start.
+ */
bool ParserTest::runJom(const QStringList &args, const QString &workingDirectory)
{
#ifdef _DEBUG
@@ -895,10 +897,6 @@ bool ParserTest::runJom(const QStringList &args, const QString &workingDirectory
QDir::setCurrent(workingDirectory);
}
m_jomProcess->setProcessChannelMode(QProcess::MergedChannels);
- if (m_bResetJomProcessEnvironment) {
- m_bResetJomProcessEnvironment = false;
- m_jomProcess->setEnvironment(QStringList());
- }
m_jomProcess->start(jomBinary, args);
bool success = true;
if (!m_jomProcess->waitForStarted()) {
@@ -911,6 +909,7 @@ bool ParserTest::runJom(const QStringList &args, const QString &workingDirectory
}
if (!workingDirectory.isNull())
QDir::setCurrent(oldWorkingDirectory);
+ m_jomProcess->setEnvironment(QStringList());
return success;
}
@@ -1031,10 +1030,8 @@ void ParserTest::environmentVariables()
QFETCH(QString, expectedVar1);
QFETCH(QString, expectedVar2);
- m_bResetJomProcessEnvironment = false;
m_jomProcess->setEnvironment(environment);
QVERIFY(runJom(QStringList() << "/f" << "test.mk" << "/nologo" << arguments, "blackbox/environmentVariables"));
- m_bResetJomProcessEnvironment = true; // reset environment, if this test fails
QCOMPARE(m_jomProcess->exitCode(), 0);
QVERIFY(!m_jomProcess->atEnd());
QCOMPARE(QString::fromLatin1(m_jomProcess->readLine().trimmed()),
@@ -1042,8 +1039,6 @@ void ParserTest::environmentVariables()
QVERIFY(!m_jomProcess->atEnd());
QCOMPARE(QString::fromLatin1(m_jomProcess->readLine().trimmed()),
QString(QLatin1String("VAR2 ") + expectedVar2).trimmed());
- m_jomProcess->setEnvironment(QStringList());
- m_bResetJomProcessEnvironment = false;
}
void ParserTest::environmentVariablesInCommands()
diff --git a/tests/tests.h b/tests/tests.h
index 45e9455..3b25eeb 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -90,5 +90,4 @@ private:
NMakeFile::Preprocessor* m_preprocessor;
NMakeFile::MakefileFactory* m_makefileFactory;
QProcess *m_jomProcess;
- bool m_bResetJomProcessEnvironment;
};