forked from qt-creator/qt-creator
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:
@@ -463,20 +463,19 @@ 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"))
|
||||
@@ -486,7 +485,7 @@ def runAndCloseApp(isQtQuickUI=False):
|
||||
if not waitForProcessRunning():
|
||||
test.fatal("Couldn't start application - leaving test")
|
||||
return False
|
||||
__closeSubprocessByPushingStop__(isQtQuickUI)
|
||||
__closeSubprocessByPushingStop__(False)
|
||||
return True
|
||||
|
||||
def __closeSubprocessByPushingStop__(isQtQuickUI):
|
||||
|
@@ -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:
|
||||
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(not ("untitled.qml" in appOutput or "MainForm.ui.qml" in appOutput),
|
||||
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")
|
||||
|
Reference in New Issue
Block a user