forked from qt-creator/qt-creator
Squish: Forward qbs' warnings about deprecated features
Change-Id: Ib99713b95d010acf4b49065ad7e20862e59476d1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -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
|
||||
|
@@ -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")
|
||||
|
Reference in New Issue
Block a user