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;
|
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
|
# this method checks the last build (if there's one) and logs the number of errors, warnings and
|
||||||
# lines within the Issues output
|
# lines within the Issues output
|
||||||
# param expectedToFail can be used to tell this function if the build was expected to fail or not
|
# 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:
|
except LookupError:
|
||||||
test.log("checkLastBuild called without a build")
|
test.log("checkLastBuild called without a build")
|
||||||
return
|
return
|
||||||
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton")
|
buildIssues = getBuildIssues()
|
||||||
model = waitForObject(":Qt Creator.Issues_QListView").model()
|
|
||||||
buildIssues = dumpBuildIssues(model)
|
|
||||||
types = map(lambda i: i[5], buildIssues)
|
types = map(lambda i: i[5], buildIssues)
|
||||||
errors = types.count("1")
|
errors = types.count("1")
|
||||||
warnings = types.count("2")
|
warnings = types.count("2")
|
||||||
gotErrors = errors != 0
|
gotErrors = errors != 0
|
||||||
test.verify(not (gotErrors ^ expectedToFail), "Errors: %s | Warnings: %s" % (errors, warnings))
|
test.verify(not (gotErrors ^ expectedToFail), "Errors: %s | Warnings: %s" % (errors, warnings))
|
||||||
# additional stuff - could be removed... or improved :)
|
# additional stuff - could be removed... or improved :)
|
||||||
test.log("Rows inside issues: %d" % model.rowCount())
|
|
||||||
if gotErrors and createTasksFileOnError:
|
if gotErrors and createTasksFileOnError:
|
||||||
createTasksFile(buildIssues)
|
createTasksFile(buildIssues)
|
||||||
return not gotErrors
|
return not gotErrors
|
||||||
|
@@ -46,4 +46,9 @@ def main():
|
|||||||
else:
|
else:
|
||||||
test.warning("Parsing project timed out")
|
test.warning("Parsing project timed out")
|
||||||
compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv")
|
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")
|
invokeMenuItem("File", "Exit")
|
||||||
|
Reference in New Issue
Block a user