OSDN Git Service

Improved build handling when build fails without errors inside build issues
authorChristian Stenger <christian.stenger@nokia.com>
Mon, 5 Sep 2011 09:00:32 +0000 (11:00 +0200)
committerChristian Stenger <christian.stenger@nokia.com>
Mon, 5 Sep 2011 11:48:13 +0000 (13:48 +0200)
Change-Id: I0958a9a8e644c245fb0930f5d165e0aac4a74ce8
Reviewed-on: http://codereview.qt.nokia.com/4184
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bill King <bill.king@nokia.com>
tests/system/shared/build_utils.py

index ade9420..8b02d2e 100644 (file)
@@ -92,7 +92,27 @@ def checkLastBuild(expectedToFail=False):
 def handleBuildFinished(object, success):
     global buildFinished, buildSucceeded
     buildFinished = True
-    buildSucceeded = checkLastBuild()
+    if success:
+        buildSucceeded = checkLastBuild()
+    else:
+        test.fatal("Build failed")
+        buildSucceeded = success
+        checkCompile()
+        checkLastBuild()
+
+# helper function to check the compilation when build wasn't successful
+def checkCompile():
+    toggleCompOutput = waitForObject("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' "
+                                      "window=':Qt Creator_Core::Internal::MainWindow' occurrence='4'}", 20000)
+    if not toggleCompOutput.checked:
+        clickButton(toggleCompOutput)
+    output = waitForObject("{type='Core::OutputWindow' unnamed='1' visible='1' windowTitle='Compile Output'"
+                                 " window=':Qt Creator_Core::Internal::MainWindow'}", 20000)
+    waitFor("len(str(output.plainText))>0",5000)
+    if str(output.plainText).lower().find("error")==-1:
+        test.log("Compile Output:\n%s" % output.plainText)
+    else:
+        test.fatal("Compile Output:\n%s" % output.plainText)
 
 # after starting to build an application this function can be used to synchronize the following tests
 # make sure to set global variable buildFinished to False before starting to build