From 7813ce9335f63e658cbd89b522275c302a552481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Wed, 21 Feb 2024 21:09:51 +0100 Subject: [PATCH] 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 --- tests/system/shared/build_utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index fbc89c5920f..a47416ca333 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -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