SquishTests: Avoid warnings when reading build issues

tst_APTW01 explicitly disables the Clang Code Model
so there is no filter category of that name.

Change-Id: I7378e11582bb0231a24404cca212a234ef7f37ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2024-02-21 21:09:51 +01:00
parent 5895ad5659
commit 7813ce9335

View File

@@ -25,13 +25,21 @@ def toggleIssuesFilter(filterName, checked):
def getBuildIssues(ignoreCodeModel=True):
# Heuristically determine whether the ClandCodeModel is loaded.
# The current implementation is inaccurate:
# The value may be "True" although the CCM was not loaded due to existing settings or
# insufficient memory. This would result in a slightly longer execution and false positive
# warnings. Since neither would cause an actual damage and a precise handling would require
# a bigger refactoring, this seems acceptable.
clangLoaded = " -noload ClangCodeModel" not in currentApplicationContext().commandLine
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton" , silent=True)
model = waitForObject(":Qt Creator.Issues_QListView").model()
if ignoreCodeModel:
if ignoreCodeModel and clangLoaded:
# filter out possible code model issues present inside the Issues pane
toggleIssuesFilter("Clang Code Model", False)
result = dumpBuildIssues(model)
if ignoreCodeModel:
if ignoreCodeModel and clangLoaded:
# reset the filter
toggleIssuesFilter("Clang Code Model", True)
return result