diff options
author | Christian Stenger <christian.stenger@digia.com> | 2014-01-23 16:29:05 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@digia.com> | 2014-01-28 12:22:38 +0100 |
commit | 8087db30a3e651f5c529a3a2ba8bb32a5cde74c9 (patch) | |
tree | 5cb9cae61f62c9a253c1d96c7e48381a955bfbe3 | |
parent | f3a7b23caa456d7a803d43ac508792bf12fb1fa9 (diff) | |
download | qt-creator-8087db30a3e651f5c529a3a2ba8bb32a5cde74c9.tar.gz |
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>
-rw-r--r-- | tests/system/shared/build_utils.py | 5 | ||||
-rw-r--r-- | tests/system/shared/project.py | 5 | ||||
-rw-r--r-- | tests/system/suite_debugger/tst_build_new_project/test.py | 4 | ||||
-rw-r--r-- | tests/system/suite_qtquick/tst_qtquick_creation/test.py | 4 | ||||
-rw-r--r-- | tests/system/suite_qtquick/tst_qtquick_creation3/test.py | 4 |
5 files changed, 13 insertions, 9 deletions
diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index b4b091b63c..3d5345c223 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -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")) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 66fc685413..abaf2af374 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -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 diff --git a/tests/system/suite_debugger/tst_build_new_project/test.py b/tests/system/suite_debugger/tst_build_new_project/test.py index 8cded60096..22a669d73b 100644 --- a/tests/system/suite_debugger/tst_build_new_project/test.py +++ b/tests/system/suite_debugger/tst_build_new_project/test.py @@ -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") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py index 46d6d55d01..ba66e594d0 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py @@ -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") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index 44431429f5..645a1b48de 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -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") |