From 210a873efbf99d3e1c9b39387a697382ba254b24 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 24 Jul 2018 13:47:25 +0200 Subject: [PATCH] Squish: Forward qbs' warnings about deprecated features Change-Id: Ib99713b95d010acf4b49065ad7e20862e59476d1 Reviewed-by: Christian Stenger --- tests/system/shared/build_utils.py | 10 ++++++---- tests/system/suite_general/tst_opencreator_qbs/test.py | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 964cec2458d..5c40c92cc29 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -25,6 +25,11 @@ import re; +def getBuildIssues(): + ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton") + model = waitForObject(":Qt Creator.Issues_QListView").model() + return dumpBuildIssues(model) + # this method checks the last build (if there's one) and logs the number of errors, warnings and # lines within the Issues output # param expectedToFail can be used to tell this function if the build was expected to fail or not @@ -36,16 +41,13 @@ def checkLastBuild(expectedToFail=False, createTasksFileOnError=True): except LookupError: test.log("checkLastBuild called without a build") return - ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton") - model = waitForObject(":Qt Creator.Issues_QListView").model() - buildIssues = dumpBuildIssues(model) + buildIssues = getBuildIssues() types = map(lambda i: i[5], buildIssues) errors = types.count("1") warnings = types.count("2") gotErrors = errors != 0 test.verify(not (gotErrors ^ expectedToFail), "Errors: %s | Warnings: %s" % (errors, warnings)) # additional stuff - could be removed... or improved :) - test.log("Rows inside issues: %d" % model.rowCount()) if gotErrors and createTasksFileOnError: createTasksFile(buildIssues) return not gotErrors diff --git a/tests/system/suite_general/tst_opencreator_qbs/test.py b/tests/system/suite_general/tst_opencreator_qbs/test.py index a20426d3599..3b7a86a42b4 100644 --- a/tests/system/suite_general/tst_opencreator_qbs/test.py +++ b/tests/system/suite_general/tst_opencreator_qbs/test.py @@ -46,4 +46,9 @@ def main(): else: test.warning("Parsing project timed out") compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv") + buildIssuesTexts = map(lambda i: str(i[3]), getBuildIssues()) + deprecationWarnings = filter(lambda s: "deprecated" in s, buildIssuesTexts) + if deprecationWarnings: + test.warning("Creator claims that the .qbs file uses deprecated features.", + "\n".join(set(deprecationWarnings))) invokeMenuItem("File", "Exit")