AutoTest: Allow limiting scan inside project settings

Enables to limit the scanning for tests and respectively any
further action to a list of user defined patterns.
If limitation is enabled and any of the filter patterns does
match the file will be processed.
If no filter pattern matches the file will be ignored.

Change-Id: I6a6de8f4137485e83b750997fb3c948dc6e79c68
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2024-04-26 13:45:26 +02:00
parent 0543085a64
commit 1fc135822f
4 changed files with 136 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ namespace Internal {
static const char SK_ACTIVE_FRAMEWORKS[] = "AutoTest.ActiveFrameworks";
static const char SK_RUN_AFTER_BUILD[] = "AutoTest.RunAfterBuild";
static const char SK_CHECK_STATES[] = "AutoTest.CheckStates";
static const char SK_APPLY_FILTER[] = "AutoTest.ApplyFilter";
static const char SK_PATH_FILTERS[] = "AutoTest.PathFilters";
static Q_LOGGING_CATEGORY(LOG, "qtc.autotest.projectsettings", QtWarningMsg)
@@ -100,6 +102,8 @@ void TestProjectSettings::load()
m_runAfterBuild = runAfterBuild.isValid() ? RunAfterBuildMode(runAfterBuild.toInt())
: RunAfterBuildMode::None;
m_checkStateCache.fromSettings(m_project->namedSettings(SK_CHECK_STATES).toMap());
m_limitToFilter = m_project->namedSettings(SK_APPLY_FILTER).toBool();
m_pathFilters = m_project->namedSettings(SK_PATH_FILTERS).toStringList();
}
void TestProjectSettings::save()
@@ -115,6 +119,8 @@ void TestProjectSettings::save()
m_project->setNamedSettings(SK_ACTIVE_FRAMEWORKS, activeFrameworks);
m_project->setNamedSettings(SK_RUN_AFTER_BUILD, int(m_runAfterBuild));
m_project->setNamedSettings(SK_CHECK_STATES, m_checkStateCache.toSettings(Qt::Checked));
m_project->setNamedSettings(SK_APPLY_FILTER, m_limitToFilter);
m_project->setNamedSettings(SK_PATH_FILTERS, m_pathFilters);
}
} // namespace Internal