mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5518 Regression : Make sure all project settings are wiped before next run
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ) );
|
||||
|
||||
Reference in New Issue
Block a user