forked from qt-creator/qt-creator
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: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -231,7 +231,8 @@ def runVerify(checkedTargets):
|
||||
for kit, config in availableConfigs:
|
||||
selectBuildConfig(len(checkedTargets), kit, config)
|
||||
test.log("Using build config '%s'" % config)
|
||||
if not runAndCloseApp():
|
||||
return
|
||||
if runAndCloseApp() == None:
|
||||
checkCompile()
|
||||
continue
|
||||
verifyBuildAndRun()
|
||||
mouseClick(waitForObject(":*Qt Creator.Clear_QToolButton"))
|
||||
|
@@ -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
|
||||
# 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
|
||||
# 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):
|
||||
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
|
||||
clickButton(runButton)
|
||||
@@ -406,11 +407,9 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None
|
||||
ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton"))
|
||||
if not buildSucceeded:
|
||||
test.fatal("Build inside run wasn't successful - leaving test")
|
||||
invokeMenuItem("File", "Exit")
|
||||
return False
|
||||
return None
|
||||
if not waitForProcessRunning():
|
||||
test.fatal("Couldn't start application - leaving test")
|
||||
invokeMenuItem("File", "Exit")
|
||||
return False
|
||||
if sType == SubprocessType.QT_QUICK_UI and os.getenv("SYSTEST_QMLVIEWER_NO_HOOK_INTO", "0") == "1":
|
||||
withHookInto = False
|
||||
|
@@ -42,6 +42,6 @@ def main():
|
||||
for kit, config in availableConfigs:
|
||||
selectBuildConfig(len(checkedTargets), kit, config)
|
||||
test.log("Testing build configuration: " + config)
|
||||
if not runAndCloseApp():
|
||||
return
|
||||
if runAndCloseApp() == None:
|
||||
checkCompile()
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
@@ -61,7 +61,9 @@ def main():
|
||||
deleteAppFromWinFW(workingDir, projectName)
|
||||
else:
|
||||
result = runAndCloseApp()
|
||||
if result:
|
||||
if result == None:
|
||||
checkCompile()
|
||||
else:
|
||||
logApplicationOutput()
|
||||
invokeMenuItem("File", "Close All Projects and Editors")
|
||||
|
||||
|
@@ -52,7 +52,9 @@ def main():
|
||||
deleteAppFromWinFW(qmlViewerPath, qmlViewer)
|
||||
else:
|
||||
result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI)
|
||||
if result:
|
||||
if result == None:
|
||||
checkCompile()
|
||||
else:
|
||||
logApplicationOutput()
|
||||
invokeMenuItem("File", "Close All Projects and Editors")
|
||||
invokeMenuItem("File", "Exit")
|
||||
|
Reference in New Issue
Block a user