mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
RegressionTest: Fixes to regression testing system to make it run
correctly on Ubuntu 12.04 - fixed size of grabbed image. Side effect is that the default window size for ResInsight is increased slightly. Removed parameter to image comparison tool to allow running regression tests on RedHat 5
This commit is contained in:
parent
483b1a0fd9
commit
cf439fbf96
@ -1401,6 +1401,8 @@ void RiaApplication::runRegressionTest(const QString& testRootPath)
|
||||
}
|
||||
m_commandQueueLock.unlock();
|
||||
|
||||
regressionTestSetFixedSizeForAllViews();
|
||||
|
||||
saveSnapshotForAllViews(generatedFolderName);
|
||||
|
||||
QDir baseDir(testCaseFolder.filePath(baseFolderName));
|
||||
@ -1777,6 +1779,7 @@ void RiaApplication::executeRegressionTests(const QString& regressionTestPath)
|
||||
{
|
||||
mainWnd->hideAllDockWindows();
|
||||
|
||||
mainWnd->setDefaultWindowSize();
|
||||
runRegressionTest(regressionTestPath);
|
||||
|
||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||
@ -1784,3 +1787,34 @@ void RiaApplication::executeRegressionTests(const QString& regressionTestPath)
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaApplication::regressionTestSetFixedSizeForAllViews()
|
||||
{
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
if (!mainWnd) return;
|
||||
|
||||
if (m_project.isNull()) return;
|
||||
|
||||
std::vector<RimCase*> projectCases;
|
||||
m_project->allCases(projectCases);
|
||||
|
||||
for (size_t i = 0; i < projectCases.size(); i++)
|
||||
{
|
||||
RimCase* ri = projectCases[i];
|
||||
if (!ri) continue;
|
||||
|
||||
for (size_t j = 0; j < ri->reservoirViews().size(); j++)
|
||||
{
|
||||
RimReservoirView* riv = ri->reservoirViews()[j];
|
||||
|
||||
if (riv && riv->viewer())
|
||||
{
|
||||
// This size is set to match the regression test reference images
|
||||
riv->viewer()->setFixedSize(1000, 745);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,6 +105,7 @@ public:
|
||||
void saveSnapshotForAllViews(const QString& snapshotFolderName);
|
||||
void runRegressionTest(const QString& testRootPath);
|
||||
void updateRegressionTest(const QString& testRootPath );
|
||||
void regressionTestSetFixedSizeForAllViews();
|
||||
|
||||
void processNonGuiEvents();
|
||||
|
||||
|
@ -72,7 +72,13 @@ bool RiaImageFileCompare::runComparison(QString imgFileName, QString refFileName
|
||||
|
||||
|
||||
//QString args = QString("-fuzz 2% -lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName));
|
||||
// The ImageMagick compare tool on RedHat 5 does not support the lowlight-color options
|
||||
// Use GCC version as a crude mechanism for disabling use of this option on RedHat5
|
||||
#if (__GNUC__ == 4 && __GNUC_MINOR__ <= 1)
|
||||
QString args = QString("-metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName));
|
||||
#else
|
||||
QString args = QString("-lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName));
|
||||
#endif
|
||||
QString completeCommand = QString("\"%1\" %2").arg(m_compareExecutable).arg(args);
|
||||
|
||||
// Launch process and wait
|
||||
|
@ -30,11 +30,7 @@ int main(int argc, char *argv[])
|
||||
RiuMainWindow window;
|
||||
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
|
||||
window.setWindowTitle("ResInsight " + platform);
|
||||
#ifdef CVF_LINUX
|
||||
window.resize(1000, 806);
|
||||
#else
|
||||
window.resize(1000, 800);
|
||||
#endif
|
||||
window.setDefaultWindowSize();
|
||||
window.show();
|
||||
|
||||
if (app.parseArguments())
|
||||
|
@ -1760,3 +1760,11 @@ void RiuMainWindow::slotExecutePaintEventPerformanceTest()
|
||||
setResultInfo(resultInfo);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::setDefaultWindowSize()
|
||||
{
|
||||
resize(1000, 810);
|
||||
}
|
||||
|
@ -93,6 +93,8 @@ public:
|
||||
|
||||
void selectedCases(std::vector<RimCase*>& cases);
|
||||
|
||||
void setDefaultWindowSize();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent* event);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user