From c46dff01995128bd97c03e6d732c85f662355bf9 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 22 Mar 2023 13:04:05 +0100 Subject: [PATCH] SquishTests: Fix checking for build issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not count code model issues as build issues when checking for them. Fixes tst_build_new_project on the Linux machines which fail for unknown reasons. Change-Id: I2cd77b0208019fc902742197c0def6d3811cfced Reviewed-by: Robert Löhning --- tests/system/shared/build_utils.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 2e96dd9ba5d..300b0ed8ba4 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -1,10 +1,37 @@ # Copyright (C) 2016 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +def toggleIssuesFilter(filterName, checked): + try: + toggleFilter = waitForObject("{type='QToolButton' toolTip='Filter by categories' " + "window=':Qt Creator_Core::Internal::MainWindow'}") + clickButton(toggleFilter) + filterMenu = waitForObject("{type='QMenu' unnamed='1' visible='1'}") + waitFor("filterMenu.visible", 1000) + + filterCategory = waitForObjectItem(filterMenu, filterName) + waitFor("filterCategory.visible", 2000) + if filterCategory.checked == checked: + test.log("Filter '%s' has already check state %s - not toggling." + % (filterName, checked)) + clickButton(toggleFilter) # close the menu again + else: + activateItem(filterCategory) + test.log("Filter '%s' check state changed to %s." % (filterName, checked)) + except: + t,v = sys.exc_info()[:2] + test.log("Exception while toggling filter '%s'" % filterName, + "%s(%s)" % (str(t), str(v))) + def getBuildIssues(): ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton") model = waitForObject(":Qt Creator.Issues_QListView").model() - return dumpBuildIssues(model) + # filter out possible code model issues present inside the Issues pane + toggleIssuesFilter("Clang Code Model", False) + result = dumpBuildIssues(model) + # reset the filter + toggleIssuesFilter("Clang Code Model", True) + return result # this method checks the last build (if there's one) and logs the number of errors, warnings and # lines within the Issues output