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:
Magne Sjaastad 2013-10-04 10:22:17 +02:00
parent 483b1a0fd9
commit cf439fbf96
6 changed files with 56 additions and 9 deletions

View File

@ -1401,6 +1401,8 @@ void RiaApplication::runRegressionTest(const QString& testRootPath)
} }
m_commandQueueLock.unlock(); m_commandQueueLock.unlock();
regressionTestSetFixedSizeForAllViews();
saveSnapshotForAllViews(generatedFolderName); saveSnapshotForAllViews(generatedFolderName);
QDir baseDir(testCaseFolder.filePath(baseFolderName)); QDir baseDir(testCaseFolder.filePath(baseFolderName));
@ -1776,7 +1778,8 @@ void RiaApplication::executeRegressionTests(const QString& regressionTestPath)
if (mainWnd) if (mainWnd)
{ {
mainWnd->hideAllDockWindows(); mainWnd->hideAllDockWindows();
mainWnd->setDefaultWindowSize();
runRegressionTest(regressionTestPath); runRegressionTest(regressionTestPath);
mainWnd->loadWinGeoAndDockToolBarLayout(); 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);
}
}
}
}

View File

@ -105,6 +105,7 @@ public:
void saveSnapshotForAllViews(const QString& snapshotFolderName); void saveSnapshotForAllViews(const QString& snapshotFolderName);
void runRegressionTest(const QString& testRootPath); void runRegressionTest(const QString& testRootPath);
void updateRegressionTest(const QString& testRootPath ); void updateRegressionTest(const QString& testRootPath );
void regressionTestSetFixedSizeForAllViews();
void processNonGuiEvents(); void processNonGuiEvents();

View File

@ -71,9 +71,15 @@ 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)); //QString args = QString("-fuzz 2% -lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName));
QString args = QString("-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
QString completeCommand = QString("\"%1\" %2").arg(m_compareExecutable).arg(args); // 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 // Launch process and wait
QProcess proc; QProcess proc;

View File

@ -30,11 +30,7 @@ int main(int argc, char *argv[])
RiuMainWindow window; RiuMainWindow window;
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)"; QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
window.setWindowTitle("ResInsight " + platform); window.setWindowTitle("ResInsight " + platform);
#ifdef CVF_LINUX window.setDefaultWindowSize();
window.resize(1000, 806);
#else
window.resize(1000, 800);
#endif
window.show(); window.show();
if (app.parseArguments()) if (app.parseArguments())

View File

@ -1760,3 +1760,11 @@ void RiuMainWindow::slotExecutePaintEventPerformanceTest()
setResultInfo(resultInfo); setResultInfo(resultInfo);
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::setDefaultWindowSize()
{
resize(1000, 810);
}

View File

@ -93,6 +93,8 @@ public:
void selectedCases(std::vector<RimCase*>& cases); void selectedCases(std::vector<RimCase*>& cases);
void setDefaultWindowSize();
protected: protected:
virtual void closeEvent(QCloseEvent* event); virtual void closeEvent(QCloseEvent* event);