System: Do not change the preferences when running regression tests.

We need the flexibility in the tests.
This commit is contained in:
Jacob Støren 2015-12-10 12:21:01 +01:00
parent 2f05ecb9ad
commit d84db62ebb

View File

@ -1771,21 +1771,6 @@ void RiaApplication::runRegressionTest(const QString& testRootPath)
// Open HTML report
QDesktopServices::openUrl(htmlReportFileName);
// Keep current preferences values to be able to restore when regression tests are completed
std::vector<QVariant> preferencesValues;
{
std::vector<caf::PdmFieldHandle*> fields;
this->preferences()->fields(fields);
for (size_t i = 0; i < fields.size(); i++)
{
QVariant v = fields[i]->uiCapability()->uiValue();
preferencesValues.push_back(v);
}
}
// Set preferences to make sure regression tests behave identical
this->preferences()->configureForRegressionTests();
for (int dirIdx = 0; dirIdx < folderList.size(); ++dirIdx)
{
QDir testCaseFolder(folderList[dirIdx].filePath());
@ -1825,18 +1810,6 @@ void RiaApplication::runRegressionTest(const QString& testRootPath)
closeProject(false);
}
// Restore preferences
{
std::vector<caf::PdmFieldHandle*> fields;
this->preferences()->fields(fields);
CVF_ASSERT(fields.size() == preferencesValues.size());
for (size_t i = 0; i < preferencesValues.size(); i++)
{
fields[i]->uiCapability()->setValueFromUi(preferencesValues[i]);
}
}
}
m_runningRegressionTests = false;