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):
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):

View File

@@ -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")