#1013 System : Regression tests for plot images

This commit is contained in:
Magne Sjaastad 2016-11-29 15:18:55 +01:00
parent 61ba5c2ca1
commit 22d09c0517
3 changed files with 17 additions and 0 deletions

View File

@ -2230,6 +2230,8 @@ void RiaApplication::runRegressionTest(const QString& testRootPath)
QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath(generatedFolderName);
saveSnapshotForAllViews(fullPathGeneratedFolder);
RicSnapshotAllPlotsToFileFeature::createSnapshotOfAllPlotsInFolder(fullPathGeneratedFolder);
QDir baseDir(testCaseFolder.filePath(baseFolderName));
QDir genDir(testCaseFolder.filePath(generatedFolderName));
QDir diffDir(testCaseFolder.filePath(diffFolderName));

View File

@ -178,6 +178,19 @@ void RicSnapshotAllPlotsToFileFeature::saveAllPlots()
// Save images in snapshot catalog relative to project directory
QString snapshotFolderName = app->createAbsolutePathFromProjectRelativePath("snapshots");
createSnapshotOfAllPlotsInFolder(snapshotFolderName);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSnapshotAllPlotsToFileFeature::createSnapshotOfAllPlotsInFolder(QString snapshotFolderName)
{
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
if (!proj) return;
QDir snapshotPath(snapshotFolderName);
if (!snapshotPath.exists())
{

View File

@ -66,6 +66,8 @@ class RicSnapshotAllPlotsToFileFeature : public caf::CmdFeature
public:
static void saveAllPlots();
static void createSnapshotOfAllPlotsInFolder(QString snapshotFolderName);
protected:
// Overrides
virtual bool isCommandEnabled() override;