mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Regression Test : Allow execution of tests starting at filter folder
This commit is contained in:
@@ -70,6 +70,9 @@ RiaRegressionTest::RiaRegressionTest(void)
|
||||
"If empty, all tests are executed.\nTo execute a subset of tests, specify folder names separated by ;",
|
||||
"");
|
||||
testFilter.uiCapability()->setUiEditorTypeName(caf::PdmUiTextEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(
|
||||
&appendTestsAfterTestFilter, "appendTestsAfterTestFilter", false, "Append All Tests After Test Filter", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
caf::PdmField<bool> showInteractiveDiffImages;
|
||||
caf::PdmField<bool> useOpenMPForGeometryCreation;
|
||||
caf::PdmField<bool> openReportInBrowser;
|
||||
caf::PdmField<bool> appendTestsAfterTestFilter;
|
||||
|
||||
protected:
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
|
||||
@@ -83,6 +83,7 @@ void logInfoTextWithTimeInSeconds(const QTime& time, const QString& msg)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaRegressionTestRunner::RiaRegressionTestRunner()
|
||||
: m_runningRegressionTests(false)
|
||||
, m_appendAllTestsAfterLastItemInFilter(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -589,6 +590,8 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution(const QDir
|
||||
return folderList;
|
||||
}
|
||||
|
||||
bool anyMatchFound = false;
|
||||
|
||||
QFileInfoList foldersMatchingTestFilter;
|
||||
|
||||
QFileInfoList folderList = directory.entryInfoList();
|
||||
@@ -600,9 +603,10 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution(const QDir
|
||||
for (const auto& s : m_testFilter)
|
||||
{
|
||||
QString trimmed = s.trimmed();
|
||||
if (baseName.contains(trimmed, Qt::CaseInsensitive))
|
||||
if (anyMatchFound || baseName.contains(trimmed, Qt::CaseInsensitive))
|
||||
{
|
||||
foldersMatchingTestFilter.push_back(fi);
|
||||
anyMatchFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -621,6 +625,11 @@ void RiaRegressionTestRunner::executeRegressionTests()
|
||||
QString testPath = testConfig.regressionTestFolder();
|
||||
QStringList testFilter = testConfig.testFilter().split(";", QString::SkipEmptyParts);
|
||||
|
||||
if (testConfig.appendTestsAfterTestFilter)
|
||||
{
|
||||
m_appendAllTestsAfterLastItemInFilter = true;
|
||||
}
|
||||
|
||||
executeRegressionTests(testPath, testFilter);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ private:
|
||||
private:
|
||||
QString m_rootPath;
|
||||
QStringList m_testFilter;
|
||||
bool m_appendAllTestsAfterLastItemInFilter;
|
||||
bool m_runningRegressionTests;
|
||||
RiaRegressionTest m_regressionTestSettings;
|
||||
};
|
||||
|
||||
@@ -1903,7 +1903,7 @@ void RiuMainWindow::slotShowRegressionTestDialog()
|
||||
regTestConfig.readSettingsFromApplicationStore();
|
||||
|
||||
caf::PdmUiPropertyViewDialog regressionTestDialog(this, ®TestConfig, "Regression Test", "");
|
||||
regressionTestDialog.resize(QSize(600, 300));
|
||||
regressionTestDialog.resize(QSize(600, 350));
|
||||
|
||||
if (regressionTestDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user