diff options
author | Christian Stenger <christian.stenger@qt.io> | 2023-03-22 13:04:05 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2023-03-28 13:20:10 +0000 |
commit | c46dff01995128bd97c03e6d732c85f662355bf9 (patch) | |
tree | f77d043bef666128887fae243f1cd58adcf4f65c | |
parent | 22909726ebc4f41fb55d61c8a98eb375d97b430e (diff) | |
download | qt-creator-c46dff01995128bd97c03e6d732c85f662355bf9.tar.gz |
SquishTests: Fix checking for build issues
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 <robert.loehning@qt.io>
-rw-r--r-- | tests/system/shared/build_utils.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 2e96dd9ba5..300b0ed8ba 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 |