Squish: Fix and update tst_qtquick_creation3

Task-number: QTCREATORBUG-20056
Change-Id: I8b0980e423c2bf8921f615d04769d91c7e660dd3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2019-04-24 20:19:52 +02:00
parent b1b52ac674
commit 97ae2d1ac0
2 changed files with 36 additions and 19 deletions

View File

@@ -463,30 +463,29 @@ def __createProjectHandleClassInformation__(className, baseClass=None):
def waitForProcessRunning(running=True): def waitForProcessRunning(running=True):
outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
if not waitFor("outputButton.checked", 10000): if not waitFor("outputButton.checked", 5000):
ensureChecked(outputButton) ensureChecked(outputButton)
waitFor("object.exists(':Qt Creator.ReRun_QToolButton')", 20000) waitFor("object.exists(':Qt Creator.ReRun_QToolButton')", 20000)
reRunButton = findObject(":Qt Creator.ReRun_QToolButton") reRunButton = findObject(":Qt Creator.ReRun_QToolButton")
waitFor("object.exists(':Qt Creator.Stop_QToolButton')", 20000) waitFor("object.exists(':Qt Creator.Stop_QToolButton')", 20000)
stopButton = findObject(":Qt Creator.Stop_QToolButton") 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 # run and close an application
# returns None if the build failed, False if the subprocess did not start, and True otherwise # 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") runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
clickButton(runButton) clickButton(runButton)
if not isQtQuickUI: waitForCompile(300000)
waitForCompile(300000) buildSucceeded = checkLastBuild()
buildSucceeded = checkLastBuild() 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") return None
return None
if not waitForProcessRunning(): if not waitForProcessRunning():
test.fatal("Couldn't start application - leaving test") test.fatal("Couldn't start application - leaving test")
return False return False
__closeSubprocessByPushingStop__(isQtQuickUI) __closeSubprocessByPushingStop__(False)
return True return True
def __closeSubprocessByPushingStop__(isQtQuickUI): def __closeSubprocessByPushingStop__(isQtQuickUI):

View File

@@ -25,21 +25,39 @@
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
def _exactlyOne_(iterable):
trueElements = 0
for element in iterable:
if element:
trueElements += 1
return trueElements == 1
def main(): def main():
startQC() startQC()
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
available = ["5.6"] available = ["5.6", "5.10"]
for qtVersion in available: for qtVersion in available:
# using a temporary directory won't mess up a potentially existing # using a temporary directory won't mess up a potentially existing
workingDir = tempDir() workingDir = tempDir()
createNewQtQuickUI(workingDir, qtVersion) checkedKits, projectName = createNewQtQuickUI(workingDir, qtVersion)
if runAndCloseApp(True) == None: checkedKitNames = Targets.getTargetsAsStrings(checkedKits)
checkCompile() test.verify(_exactlyOne_(map(lambda name: qtVersion in name, checkedKitNames)),
else: "The requested kit should have been checked")
appOutput = logApplicationOutput() if qtVersion == "5.10":
test.verify(not ("untitled.qml" in appOutput or "MainForm.ui.qml" in appOutput), test.verify(not any(map(lambda name: "5.6" in name, checkedKitNames)),
"Does the Application Output indicate QML errors?") "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", "Close All Projects and Editors")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")