mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added dialog for configuration and execution of regression test from
Debug->Regression Test Dialog Generalized read/write of pdm object fields using QSettings
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RiuWellImportWizard.h"
|
||||
#include "RimCalcScript.h"
|
||||
#include "RiaRegressionTest.h"
|
||||
|
||||
|
||||
|
||||
@@ -202,6 +203,7 @@ void RiuMainWindow::createActions()
|
||||
m_snapshotAllViewsToFile = new QAction(QIcon(":/SnapShotSaveViews.png"), "Snapshot All Views To File", this);
|
||||
|
||||
m_createCommandObject = new QAction("Create Command Object", this);
|
||||
m_showRegressionTestDialog = new QAction("Regression Test Dialog", this);
|
||||
|
||||
m_saveProjectAction = new QAction(QIcon(":/Save.png"), "&Save Project", this);
|
||||
m_saveProjectAsAction = new QAction(QIcon(":/Save.png"), "Save Project &As", this);
|
||||
@@ -227,6 +229,7 @@ void RiuMainWindow::createActions()
|
||||
connect(m_snapshotAllViewsToFile, SIGNAL(triggered()), SLOT(slotSnapshotAllViewsToFile()));
|
||||
|
||||
connect(m_createCommandObject, SIGNAL(triggered()), SLOT(slotCreateCommandObject()));
|
||||
connect(m_showRegressionTestDialog, SIGNAL(triggered()), SLOT(slotShowRegressionTestDialog()));
|
||||
|
||||
connect(m_saveProjectAction, SIGNAL(triggered()), SLOT(slotSaveProject()));
|
||||
connect(m_saveProjectAsAction, SIGNAL(triggered()), SLOT(slotSaveProjectAs()));
|
||||
@@ -364,7 +367,8 @@ void RiuMainWindow::createMenus()
|
||||
debugMenu->addAction(m_mockInputModelAction);
|
||||
debugMenu->addSeparator();
|
||||
debugMenu->addAction(m_createCommandObject);
|
||||
|
||||
debugMenu->addSeparator();
|
||||
debugMenu->addAction(m_showRegressionTestDialog);
|
||||
|
||||
connect(debugMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshDebugActions()));
|
||||
|
||||
@@ -1197,13 +1201,13 @@ void RiuMainWindow::slotEditPreferences()
|
||||
if (preferencesDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
// Write preferences using QSettings and apply them to the application
|
||||
app->writePreferences();
|
||||
app->writeFieldsToApplicationStore(app->preferences());
|
||||
app->applyPreferences();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Read back currently stored values using QSettings
|
||||
app->readPreferences();
|
||||
app->readFieldsFromApplicationStore(app->preferences());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1700,3 +1704,28 @@ void RiuMainWindow::slotCreateCommandObject()
|
||||
app->project()->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotShowRegressionTestDialog()
|
||||
{
|
||||
RiaRegressionTest regTestConfig;
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
app->readFieldsFromApplicationStore(®TestConfig);
|
||||
|
||||
RiuPreferencesDialog regressionTestDialog(this, ®TestConfig, "Regression Test");
|
||||
if (regressionTestDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
// Write preferences using QSettings and apply them to the application
|
||||
app->writeFieldsToApplicationStore(®TestConfig);
|
||||
|
||||
QString currentApplicationPath = QDir::currentPath();
|
||||
|
||||
QDir::setCurrent(regTestConfig.applicationWorkingFolder);
|
||||
app->executeRegressionTests(regTestConfig.regressionTestFolder);
|
||||
|
||||
QDir::setCurrent(currentApplicationPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,7 @@ private:
|
||||
QAction* m_snapshotAllViewsToFile;
|
||||
|
||||
QAction* m_createCommandObject;
|
||||
QAction* m_showRegressionTestDialog;
|
||||
|
||||
// Help actions
|
||||
QAction* m_aboutAction;
|
||||
@@ -225,6 +226,8 @@ private slots:
|
||||
|
||||
void slotCreateCommandObject();
|
||||
|
||||
void slotShowRegressionTestDialog();
|
||||
|
||||
// Mock models
|
||||
void slotMockModel();
|
||||
void slotMockResultsModel();
|
||||
|
||||
Reference in New Issue
Block a user