#5518 Regression : Make sure all project settings are wiped before next run

This commit is contained in:
Magne Sjaastad
2020-02-11 13:49:36 +01:00
parent f0509d080a
commit 5ced642ca2
3 changed files with 28 additions and 2 deletions

View File

@@ -1669,3 +1669,23 @@ void RiaApplication::loadAndUpdatePlotData()
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::resetProject()
{
if ( m_project.notNull() )
{
delete m_project.p();
m_project = nullptr;
}
if ( m_preferences )
{
delete m_preferences;
m_preferences = nullptr;
}
initialize();
}

View File

@@ -225,6 +225,9 @@ protected:
void loadAndUpdatePlotData();
friend class RiaRegressionTestRunner;
void resetProject();
protected:
cvf::ref<cvf::Font> m_defaultSceneFont;
cvf::ref<cvf::Font> m_defaultAnnotationFont;

View File

@@ -168,6 +168,8 @@ void RiaRegressionTestRunner::runRegressionTest()
timeStamp.start();
logInfoTextWithTimeInSeconds( timeStamp, "Starting regression tests\n" );
RiaApplication* app = RiaApplication::instance();
for ( const QFileInfo& folderFileInfo : folderList )
{
QDir testCaseFolder( folderFileInfo.filePath() );
@@ -194,8 +196,6 @@ void RiaRegressionTestRunner::runRegressionTest()
{
logInfoTextWithTimeInSeconds( timeStamp, "Initializing test :" + testCaseFolder.absolutePath() );
RiaApplication* app = RiaApplication::instance();
app->loadProject( testCaseFolder.filePath( projectFileName ) );
// Wait until all command objects have completed
@@ -220,6 +220,9 @@ void RiaRegressionTestRunner::runRegressionTest()
}
}
// Do a complete reset of project settings to avoid transfer of settings to next regression test
app->resetProject();
QDir baseDir( testCaseFolder.filePath( baseFolderName ) );
QDir genDir( testCaseFolder.filePath( generatedFolderName ) );
QDir diffDir( testCaseFolder.filePath( diffFolderName ) );