Commit 8087db30 authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Do not invoke Exit on AUT inside helper functions



Quitting the AUT should always be reserved for the main function
of a test case.

Change-Id: I1a90e7c1e327cde37280e9d3130b30216798382c
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent f3a7b23c
...@@ -231,7 +231,8 @@ def runVerify(checkedTargets): ...@@ -231,7 +231,8 @@ def runVerify(checkedTargets):
for kit, config in availableConfigs: for kit, config in availableConfigs:
selectBuildConfig(len(checkedTargets), kit, config) selectBuildConfig(len(checkedTargets), kit, config)
test.log("Using build config '%s'" % config) test.log("Using build config '%s'" % config)
if not runAndCloseApp(): if runAndCloseApp() == None:
return checkCompile()
continue
verifyBuildAndRun() verifyBuildAndRun()
mouseClick(waitForObject(":*Qt Creator.Clear_QToolButton")) mouseClick(waitForObject(":*Qt Creator.Clear_QToolButton"))
...@@ -397,6 +397,7 @@ def waitForProcessRunning(running=True): ...@@ -397,6 +397,7 @@ def waitForProcessRunning(running=True):
# userDefinedType - if you set sType to SubprocessType.USER_DEFINED you must(!) specify the WindowType for hooking into # userDefinedType - if you set sType to SubprocessType.USER_DEFINED you must(!) specify the WindowType for hooking into
# by yourself (or use the function parameter) # by yourself (or use the function parameter)
# ATTENTION! Make sure this function won't fail and the sub-process will end when the function returns # ATTENTION! Make sure this function won't fail and the sub-process will end when the function returns
# returns None if the build failed, False if the subprocess did not start, and True otherwise
def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None, quickVersion=1): def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None, quickVersion=1):
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
clickButton(runButton) clickButton(runButton)
...@@ -406,11 +407,9 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None ...@@ -406,11 +407,9 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None
ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")) ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton"))
if not buildSucceeded: if not buildSucceeded:
test.fatal("Build inside run wasn't successful - leaving test") test.fatal("Build inside run wasn't successful - leaving test")
invokeMenuItem("File", "Exit") return None
return False
if not waitForProcessRunning(): if not waitForProcessRunning():
test.fatal("Couldn't start application - leaving test") test.fatal("Couldn't start application - leaving test")
invokeMenuItem("File", "Exit")
return False return False
if sType == SubprocessType.QT_QUICK_UI and os.getenv("SYSTEST_QMLVIEWER_NO_HOOK_INTO", "0") == "1": if sType == SubprocessType.QT_QUICK_UI and os.getenv("SYSTEST_QMLVIEWER_NO_HOOK_INTO", "0") == "1":
withHookInto = False withHookInto = False
......
...@@ -42,6 +42,6 @@ def main(): ...@@ -42,6 +42,6 @@ def main():
for kit, config in availableConfigs: for kit, config in availableConfigs:
selectBuildConfig(len(checkedTargets), kit, config) selectBuildConfig(len(checkedTargets), kit, config)
test.log("Testing build configuration: " + config) test.log("Testing build configuration: " + config)
if not runAndCloseApp(): if runAndCloseApp() == None:
return checkCompile()
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
...@@ -61,7 +61,9 @@ def main(): ...@@ -61,7 +61,9 @@ def main():
deleteAppFromWinFW(workingDir, projectName) deleteAppFromWinFW(workingDir, projectName)
else: else:
result = runAndCloseApp() result = runAndCloseApp()
if result: if result == None:
checkCompile()
else:
logApplicationOutput() logApplicationOutput()
invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Close All Projects and Editors")
......
...@@ -52,7 +52,9 @@ def main(): ...@@ -52,7 +52,9 @@ def main():
deleteAppFromWinFW(qmlViewerPath, qmlViewer) deleteAppFromWinFW(qmlViewerPath, qmlViewer)
else: else:
result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI) result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI)
if result: if result == None:
checkCompile()
else:
logApplicationOutput() logApplicationOutput()
invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Close All Projects and Editors")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment