diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index bc60707abae..bcd4afeba51 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -61,3 +61,38 @@ def which(program): return exe_file + ".exe" 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()) diff --git a/tests/system/suite_general/tst_build_speedcrunch/test.py b/tests/system/suite_general/tst_build_speedcrunch/test.py index 51730c40854..241a208ee45 100644 --- a/tests/system/suite_general/tst_build_speedcrunch/test.py +++ b/tests/system/suite_general/tst_build_speedcrunch/test.py @@ -27,8 +27,8 @@ def main(): # Wait for, and test if the build succeeded installLazySignalHandler("{type='ProjectExplorer::BuildManager'}", "buildQueueFinished(bool)", "handleBuildFinished") 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 # Add a new run configuration diff --git a/tests/system/suite_general/tst_cmake_speedcrunch/test.py b/tests/system/suite_general/tst_cmake_speedcrunch/test.py index 6690cbd651c..70fcdaf7fe9 100644 --- a/tests/system/suite_general/tst_cmake_speedcrunch/test.py +++ b/tests/system/suite_general/tst_cmake_speedcrunch/test.py @@ -41,7 +41,8 @@ def main(): # Wait for, and test if the build succeeded 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")