From 8485f64c6b659035f9ec7dee61017158a5834828 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 4 Feb 2013 11:08:38 +0100 Subject: [PATCH] Squish: Fix verification of compile output Change-Id: I1c55e826a79fa0f36d2870cfcb08a325ba6408e1 Reviewed-by: Robert Loehning --- tests/system/shared/build_utils.py | 13 ++++++++----- tests/system/suite_CCOM/tst_CCOM01/test.py | 2 +- tests/system/suite_SCOM/tst_SCOM01/test.py | 2 +- tests/system/suite_SCOM/tst_SCOM05/test.py | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 370381b2bee..c858333fdea 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -80,15 +80,18 @@ def checkCompile(): ensureChecked(":Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton") output = waitForObject(":Qt Creator.Compile Output_Core::OutputWindow") waitFor("len(str(output.plainText))>0",5000) - success = str(output.plainText).endswith("exited normally.") - if success: + if compileSucceeded(output.plainText): if os.getenv("SYSTEST_DEBUG") == "1": test.log("Compile Output:\n%s" % output.plainText) - else: - test.passes("Compile successful") + test.passes("Compile successful") + return True else: test.fail("Compile Output:\n%s" % output.plainText) - return success + return False + +def compileSucceeded(compileOutput): + return None != re.match(".*exited normally\.\n\d\d:\d\d:\d\d: Elapsed time: " + "(\d:)?\d{2}:\d\d\.$", str(compileOutput), re.S) # helper method that parses the Issues output and writes a tasks file def createTasksFile(list): diff --git a/tests/system/suite_CCOM/tst_CCOM01/test.py b/tests/system/suite_CCOM/tst_CCOM01/test.py index 4c68038b975..7924e8c6b14 100755 --- a/tests/system/suite_CCOM/tst_CCOM01/test.py +++ b/tests/system/suite_CCOM/tst_CCOM01/test.py @@ -27,7 +27,7 @@ def main(): # verify build successful ensureChecked(waitForObject(":Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton")) compileOutput = waitForObject(":Qt Creator.Compile Output_Core::OutputWindow") - if not test.verify(str(compileOutput.plainText).endswith("exited normally."), + if not test.verify(compileSucceeded(compileOutput.plainText), "Verifying building of existing complex qt application."): test.log(compileOutput.plainText) # exit diff --git a/tests/system/suite_SCOM/tst_SCOM01/test.py b/tests/system/suite_SCOM/tst_SCOM01/test.py index 75b33d92d63..b279fc55257 100644 --- a/tests/system/suite_SCOM/tst_SCOM01/test.py +++ b/tests/system/suite_SCOM/tst_SCOM01/test.py @@ -19,7 +19,7 @@ def main(): # check output if build successful ensureChecked(waitForObject(":Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton")) compileOutput = waitForObject(":Qt Creator.Compile Output_Core::OutputWindow") - if not test.verify(str(compileOutput.plainText).endswith("exited normally."), + if not test.verify(compileSucceeded(compileOutput.plainText), "Verifying building of simple qt quick application."): test.log(compileOutput.plainText) # exit qt creator diff --git a/tests/system/suite_SCOM/tst_SCOM05/test.py b/tests/system/suite_SCOM/tst_SCOM05/test.py index affea39bcda..505c9ff0c74 100644 --- a/tests/system/suite_SCOM/tst_SCOM05/test.py +++ b/tests/system/suite_SCOM/tst_SCOM05/test.py @@ -44,7 +44,7 @@ def main(): ensureChecked(waitForObject(":Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton")) outputLog = str(waitForObject(":Qt Creator.Compile Output_Core::OutputWindow").plainText) # verify that project was built successfully - test.verify(outputLog.endswith("exited normally."), + test.verify(compileSucceeded(outputLog), "Verifying building of simple qt quick application while multiple projects are open.") # verify that proper project (project 2) was build test.verify(projectName2 in outputLog and projectName1 not in outputLog,