2018-03-08 03:10:15 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-01-09 08:15:34 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-03-08 03:10:15 -06:00
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-11-12 00:33:08 -06:00
|
|
|
#include "RiaRegressionTest.h"
|
|
|
|
|
2018-11-11 04:52:53 -06:00
|
|
|
#include <QFileInfo>
|
2018-03-08 03:10:15 -06:00
|
|
|
#include <QSize>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
class QDir;
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RiaRegressionTestRunner
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static RiaRegressionTestRunner* instance();
|
|
|
|
|
2022-03-03 03:15:32 -06:00
|
|
|
static void createSingleton();
|
|
|
|
static void deleteSingleton();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void executeRegressionTests( const QString& regressionTestPath, const QStringList& testFilter );
|
2018-03-08 03:10:15 -06:00
|
|
|
void executeRegressionTests();
|
|
|
|
|
|
|
|
bool isRunningRegressionTests() const;
|
2018-11-12 00:33:08 -06:00
|
|
|
bool useOpenMPForGeometryCreation() const;
|
2018-03-08 03:10:15 -06:00
|
|
|
|
2022-01-20 06:21:32 -06:00
|
|
|
RiaRegressionTest::PlotEngine overridePlotEngine() const;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void updateRegressionTest( const QString& testRootPath );
|
2019-12-05 02:25:44 -06:00
|
|
|
|
|
|
|
static void setDefaultSnapshotSizeFor3dViews();
|
|
|
|
static void setDefaultSnapshotSizeForPlotWindows();
|
2018-03-08 03:10:15 -06:00
|
|
|
|
|
|
|
private:
|
2018-04-27 05:40:46 -05:00
|
|
|
RiaRegressionTestRunner();
|
|
|
|
|
2018-11-11 04:52:53 -06:00
|
|
|
void runRegressionTest();
|
2018-03-08 03:10:15 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool findAndExecuteCommandFiles( const QDir& testCaseFolder,
|
|
|
|
const RiaRegressionTest& regressionTestConfig,
|
|
|
|
const QString& htmlReportFileName );
|
2018-11-11 04:52:53 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QString generateHtmlReport( const QFileInfoList& folderList,
|
|
|
|
const QString& baseFolderName,
|
|
|
|
const QString& generatedFolderName,
|
|
|
|
const QString& diffFolderName,
|
|
|
|
const QDir& testDir );
|
2018-11-11 04:52:53 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void removeDirectoryWithContent( QDir& dirToDelete );
|
2018-11-11 04:52:53 -06:00
|
|
|
static QSize regressionDefaultImageSize();
|
2019-09-06 03:40:57 -05:00
|
|
|
static QString diff2htmlHeaderText( const QString& testRootPath );
|
|
|
|
QFileInfoList subDirectoriesForTestExecution( const QDir& directory );
|
2018-03-08 03:10:15 -06:00
|
|
|
|
|
|
|
private:
|
2018-11-12 00:33:08 -06:00
|
|
|
QString m_rootPath;
|
|
|
|
QStringList m_testFilter;
|
2019-04-24 01:06:13 -05:00
|
|
|
bool m_appendAllTestsAfterLastItemInFilter;
|
2018-11-12 00:33:08 -06:00
|
|
|
bool m_runningRegressionTests;
|
|
|
|
RiaRegressionTest m_regressionTestSettings;
|
2022-03-03 03:15:32 -06:00
|
|
|
|
|
|
|
static RiaRegressionTestRunner* sm_singleton;
|
2018-03-08 03:10:15 -06:00
|
|
|
};
|