forked from qt-creator/qt-creator
Improved check for last build status
Change-Id: I18f8839daeb5f21957b9ab8102341f25dd77720d Reviewed-on: http://codereview.qt.nokia.com/3651 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bill King <bill.king@nokia.com>
This commit is contained in:
committed by
Bill King
parent
059e5f30de
commit
648e985cd6
@@ -61,3 +61,38 @@ def which(program):
|
|||||||
return exe_file + ".exe"
|
return exe_file + ".exe"
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def checkLastBuild(expectedToFail=False):
|
||||||
|
try:
|
||||||
|
# can't use waitForObject() 'cause visible is always 0
|
||||||
|
buildProg = findObject("{type='ProjectExplorer::Internal::BuildProgress' unnamed='1' }")
|
||||||
|
except LookupError:
|
||||||
|
test.log("checkLastBuild called without a build")
|
||||||
|
return
|
||||||
|
# get labels for errors and warnings
|
||||||
|
children = object.children(buildProg)
|
||||||
|
if len(children)<4:
|
||||||
|
test.fatal("Leaving checkLastBuild()", "Referred code seems to have changed - method has to get adjusted")
|
||||||
|
return
|
||||||
|
errors = children[2].text
|
||||||
|
if errors == "":
|
||||||
|
errors = "none"
|
||||||
|
warnings = children[4].text
|
||||||
|
if warnings == "":
|
||||||
|
warnings = "none"
|
||||||
|
gotErrors = errors != "none" and errors != "0"
|
||||||
|
if (gotErrors and expectedToFail) or (not expectedToFail and not gotErrors):
|
||||||
|
test.passes("Errors: %s" % errors)
|
||||||
|
test.passes("Warnings: %s" % warnings)
|
||||||
|
else:
|
||||||
|
test.fail("Errors: %s" % errors)
|
||||||
|
test.fail("Warnings: %s" % warnings)
|
||||||
|
# additional stuff - could be removed... or improved :)
|
||||||
|
toggleBuildIssues = waitForObject("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' "
|
||||||
|
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 20000)
|
||||||
|
if not toggleBuildIssues.checked:
|
||||||
|
clickButton(toggleBuildIssues)
|
||||||
|
list=waitForObject("{type='QListView' unnamed='1' visible='1' "
|
||||||
|
"window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Build Issues'}", 20000)
|
||||||
|
model = list.model()
|
||||||
|
test.log("Rows inside build-issues: %d" % model.rowCount())
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ def main():
|
|||||||
# Wait for, and test if the build succeeded
|
# Wait for, and test if the build succeeded
|
||||||
installLazySignalHandler("{type='ProjectExplorer::BuildManager'}", "buildQueueFinished(bool)", "handleBuildFinished")
|
installLazySignalHandler("{type='ProjectExplorer::BuildManager'}", "buildQueueFinished(bool)", "handleBuildFinished")
|
||||||
waitFor("buildFinished == True", 30000)
|
waitFor("buildFinished == True", 30000)
|
||||||
test.verify(buildSucceeded == 1)
|
test.verify(buildSucceeded == 1) # buildSucceeded is True for me - even on failed builds; remove this check at all?
|
||||||
|
checkLastBuild()
|
||||||
# Now that this has finished, test adding a new build configuration
|
# Now that this has finished, test adding a new build configuration
|
||||||
|
|
||||||
# Add a new run configuration
|
# Add a new run configuration
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ def main():
|
|||||||
|
|
||||||
# Wait for, and test if the build succeeded
|
# Wait for, and test if the build succeeded
|
||||||
waitFor("buildFinished == True", 300000)
|
waitFor("buildFinished == True", 300000)
|
||||||
test.verify(buildSucceeded == 1)
|
test.verify(buildSucceeded == 1) # buildSucceeded is True for me - even on failed builds; remove this check at all?
|
||||||
|
checkLastBuild()
|
||||||
|
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user