OSDN Git Service

Squish: Improved function checkCompile()
authorRobert Loehning <robert.loehning@nokia.com>
Thu, 6 Oct 2011 14:46:03 +0000 (16:46 +0200)
committerRobert Löhning <robert.loehning@nokia.com>
Thu, 6 Oct 2011 15:43:20 +0000 (17:43 +0200)
Change-Id: Ib1b0dada442dc58f1e56343cf4ae602650291fcf
Reviewed-on: http://codereview.qt-project.org/6167
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
tests/system/shared/build_utils.py
tests/system/suite_qtquick/tst_qtquick_creation/test.py
tests/system/suite_qtquick/tst_qtquick_creation2/test.py

index 0f99082..58728bc 100644 (file)
@@ -91,10 +91,12 @@ def checkCompile():
     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:
+    success = str(output.plainText).lower().find("error")==-1
+    if success:
         test.log("Compile Output:\n%s" % output.plainText)
     else:
-        test.fatal("Compile Output:\n%s" % output.plainText)
+        test.fail("Compile Output:\n%s" % output.plainText)
+    return success
 
 # helper method that parses the Issues output and writes a tasks file
 def createTasksFile(list):
index f3ec843..f92d57e 100644 (file)
@@ -13,11 +13,13 @@ def main():
     test.log("Building project")
     invokeMenuItem("Build","Build All")
     waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000)
-    checkCompile()
-    checkLastBuild()
-    test.log("Running project (includes build)")
-    if runAndCloseApp():
-        logApplicationOutput()
+    if not checkCompile():
+        test.fatal("Compile failed")
+    else:
+        checkLastBuild()
+        test.log("Running project (includes build)")
+        if runAndCloseApp():
+            logApplicationOutput()
     invokeMenuItem("File", "Exit")
 
 def createNewQtQuickApplication():
index 9a4923a..1e70ab4 100644 (file)
@@ -18,11 +18,13 @@ def main():
     test.log("Building project")
     invokeMenuItem("Build","Build All")
     waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000)
-    checkCompile()
-    checkLastBuild()
-    test.log("Running project (includes build)")
-    if runAndCloseApp():
-        logApplicationOutput()
+    if not checkCompile():
+        test.fatal("Compile failed")
+    else:
+        checkLastBuild()
+        test.log("Running project (includes build)")
+        if runAndCloseApp():
+            logApplicationOutput()
     invokeMenuItem("File", "Exit")
 
 def prepareTemplate(sourceExample):