diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-17 09:42:58 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-17 12:47:24 +0200 |
commit | 829a08047fdf383e6dbbace85678053c281b0d34 (patch) | |
tree | a87c8f62ce04166670117ca8af354f5a4ff4c948 /tests/system | |
parent | 3f57cdfba9a3ea112420b7c720799f9ca267755c (diff) | |
parent | 9cf336b4bce0744ad146f8c3a5f9fe02638461bd (diff) |
Merge remote-tracking branch 'origin/4.9'
Conflicts:
src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
Change-Id: I473084232ab99c18e2316154656de0035af02628
Diffstat (limited to 'tests/system')
-rw-r--r-- | tests/system/shared/project.py | 21 | ||||
-rw-r--r-- | tests/system/suite_qtquick/tst_qtquick_creation3/test.py | 34 |
2 files changed, 36 insertions, 19 deletions
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 00271bd77e..8a0d69b222 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -463,30 +463,29 @@ def __createProjectHandleClassInformation__(className, baseClass=None): def waitForProcessRunning(running=True): outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") - if not waitFor("outputButton.checked", 10000): + if not waitFor("outputButton.checked", 5000): ensureChecked(outputButton) waitFor("object.exists(':Qt Creator.ReRun_QToolButton')", 20000) reRunButton = findObject(":Qt Creator.ReRun_QToolButton") waitFor("object.exists(':Qt Creator.Stop_QToolButton')", 20000) stopButton = findObject(":Qt Creator.Stop_QToolButton") - return waitFor("(reRunButton.enabled != running) and (stopButton.enabled == running)", 10000) + return waitFor("(reRunButton.enabled != running) and (stopButton.enabled == running)", 5000) # run and close an application # returns None if the build failed, False if the subprocess did not start, and True otherwise -def runAndCloseApp(isQtQuickUI=False): +def runAndCloseApp(): runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") clickButton(runButton) - if not isQtQuickUI: - waitForCompile(300000) - buildSucceeded = checkLastBuild() - ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")) - if not buildSucceeded: - test.fatal("Build inside run wasn't successful - leaving test") - return None + waitForCompile(300000) + buildSucceeded = checkLastBuild() + ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")) + if not buildSucceeded: + test.fatal("Build inside run wasn't successful - leaving test") + return None if not waitForProcessRunning(): test.fatal("Couldn't start application - leaving test") return False - __closeSubprocessByPushingStop__(isQtQuickUI) + __closeSubprocessByPushingStop__(False) return True def __closeSubprocessByPushingStop__(isQtQuickUI): diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index e3171153c7..adf7c4f62f 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -25,21 +25,39 @@ source("../../shared/qtcreator.py") +def _exactlyOne_(iterable): + trueElements = 0 + for element in iterable: + if element: + trueElements += 1 + return trueElements == 1 + def main(): startQC() if not startedWithoutPluginError(): return - available = ["5.6"] + available = ["5.6", "5.10"] for qtVersion in available: # using a temporary directory won't mess up a potentially existing workingDir = tempDir() - createNewQtQuickUI(workingDir, qtVersion) - if runAndCloseApp(True) == None: - checkCompile() - else: - appOutput = logApplicationOutput() - test.verify(not ("untitled.qml" in appOutput or "MainForm.ui.qml" in appOutput), - "Does the Application Output indicate QML errors?") + checkedKits, projectName = createNewQtQuickUI(workingDir, qtVersion) + checkedKitNames = Targets.getTargetsAsStrings(checkedKits) + test.verify(_exactlyOne_(map(lambda name: qtVersion in name, checkedKitNames)), + "The requested kit should have been checked") + if qtVersion == "5.10": + test.verify(not any(map(lambda name: "5.6" in name, checkedKitNames)), + "The 5.6 kit should not have been checked when 5.10 is required") + clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")) + if not waitForProcessRunning(): + test.fatal("Couldn't start application - leaving test") + continue + if test.verify(not waitForProcessRunning(False), "The application should keep running"): + __closeSubprocessByPushingStop__(True) + appOutput = logApplicationOutput() + test.verify(_exactlyOne_(map(lambda ver: ver in appOutput, available)), + "Does Creator use qmlscene from a checked kit?") + test.verify(projectName + ".qml:" not in appOutput, + "Does the Application Output indicate QML errors?") invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Exit") |