forked from qt-creator/qt-creator
Squish: Update Qt Quick tests to reflect new available versions
Change-Id: I60d4b2ca64825101358774a4e04cceb3040fc630 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -136,13 +136,13 @@ class SubprocessType:
|
||||
USER_DEFINED=3
|
||||
|
||||
@staticmethod
|
||||
def getWindowType(subprocessType, qtQuickVersion=1):
|
||||
def getWindowType(subprocessType, qtQuickVersion="1.1"):
|
||||
if subprocessType == SubprocessType.QT_WIDGET:
|
||||
return "QMainWindow"
|
||||
if subprocessType == SubprocessType.QT_QUICK_APPLICATION:
|
||||
return "QtQuick%dApplicationViewer" % qtQuickVersion
|
||||
return "QtQuick%sApplicationViewer" % qtQuickVersion[0]
|
||||
if subprocessType == SubprocessType.QT_QUICK_UI:
|
||||
if qtQuickVersion == 1:
|
||||
if qtQuickVersion == "1.1":
|
||||
return "QDeclarativeViewer"
|
||||
else:
|
||||
return "QQuickView"
|
||||
|
||||
@@ -90,7 +90,7 @@ def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRun
|
||||
clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
|
||||
"window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
|
||||
|
||||
def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port, quickVersion=1):
|
||||
def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port, quickVersion="1.1"):
|
||||
switchViewTo(ViewConstants.PROJECTS)
|
||||
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN, True)
|
||||
|
||||
@@ -107,7 +107,7 @@ def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, por
|
||||
"Using fallback of pushing STOP inside Creator.")
|
||||
return None
|
||||
test.log("Using (QtVersion/mkspec) %s/%s with SquishPath %s" % (qtVersion, mkspec, squishPath))
|
||||
if quickVersion == 1:
|
||||
if quickVersion == "1.1":
|
||||
if platform.system() == "Darwin":
|
||||
executable = os.path.abspath(os.path.dirname(qmake) + "/QMLViewer.app")
|
||||
else:
|
||||
|
||||
@@ -129,19 +129,23 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True):
|
||||
clickButton(waitForObject(":Next_QPushButton"))
|
||||
return str(projectName)
|
||||
|
||||
def __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls):
|
||||
def __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion):
|
||||
comboBox = waitForObject("{type='QComboBox' unnamed='1' visible='1' "
|
||||
"leftWidget={text='Qt Quick component set:' type='QLabel' unnamed='1' "
|
||||
"visible='1'}}")
|
||||
if qtQuickVersion == 1:
|
||||
if qtQuickVersion == "1.1":
|
||||
selectFromCombo(comboBox, "Qt Quick 1.1")
|
||||
if withControls:
|
||||
if controlsVersion:
|
||||
test.warning("Controls are not available for Quick 1.")
|
||||
elif qtQuickVersion == 2:
|
||||
if withControls:
|
||||
selectFromCombo(comboBox, "Qt Quick Controls 1.0")
|
||||
elif qtQuickVersion[:2] == "2.":
|
||||
if controlsVersion:
|
||||
if controlsVersion in ("1.0", "1.1"):
|
||||
selectFromCombo(comboBox, "Qt Quick Controls %s" % controlsVersion)
|
||||
else:
|
||||
test.fatal("Got unknown Qt Quick Controls version: %s - trying to continue."
|
||||
% str(controlsVersion))
|
||||
else:
|
||||
selectFromCombo(comboBox, "Qt Quick 2.0")
|
||||
selectFromCombo(comboBox, "Qt Quick %s" % qtQuickVersion)
|
||||
else:
|
||||
test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion))
|
||||
label = waitForObject("{type='QLabel' unnamed='1' visible='1' text?='Creates a *' }")
|
||||
@@ -269,11 +273,11 @@ def createProject_Qt_Console(path, projectName, checks = True):
|
||||
return checkedTargets
|
||||
|
||||
def createNewQtQuickApplication(workingDir, projectName = None,
|
||||
targets=Targets.desktopTargetClasses(), qtQuickVersion=1,
|
||||
fromWelcome=False, withControls=False):
|
||||
targets=Targets.desktopTargetClasses(), qtQuickVersion="1.1",
|
||||
fromWelcome=False, controlsVersion=None):
|
||||
available = __createProjectOrFileSelectType__(" Applications", "Qt Quick Application", fromWelcome)
|
||||
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
|
||||
requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
|
||||
requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion)
|
||||
__modifyAvailableTargets__(available, requiredQt)
|
||||
checkedTargets = __chooseTargets__(targets, available)
|
||||
snooze(1)
|
||||
@@ -283,12 +287,12 @@ def createNewQtQuickApplication(workingDir, projectName = None,
|
||||
progressBarWait(10000)
|
||||
return checkedTargets, projectName
|
||||
|
||||
def createNewQtQuickUI(workingDir, qtQuickVersion=1, withControls=False):
|
||||
def createNewQtQuickUI(workingDir, qtQuickVersion="1.1", controlsVersion=None):
|
||||
__createProjectOrFileSelectType__(" Applications", "Qt Quick UI")
|
||||
if workingDir == None:
|
||||
workingDir = tempDir()
|
||||
projectName = __createProjectSetNameAndPath__(workingDir)
|
||||
__createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
|
||||
__createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion)
|
||||
__createProjectHandleLastPage__()
|
||||
return projectName
|
||||
|
||||
@@ -399,7 +403,7 @@ def waitForProcessRunning(running=True):
|
||||
# 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):
|
||||
def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None, quickVersion="1.1"):
|
||||
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
|
||||
clickButton(runButton)
|
||||
if sType != SubprocessType.QT_QUICK_UI:
|
||||
|
||||
@@ -33,7 +33,7 @@ import re
|
||||
|
||||
def main():
|
||||
global tmpSettingsDir
|
||||
quickCombinations = [[1,False], [2,False], [2,True]]
|
||||
quickCombinations = [["1.1",None], ["2.1",None], ["2.2",None], ["2.1","1.0"], ["2.2","1.1"]]
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
|
||||
@@ -33,12 +33,13 @@ def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
for targ, qVer in {Targets.DESKTOP_480_GCC:1, Targets.DESKTOP_501_DEFAULT:2}.items():
|
||||
# TODO provide Qt5.2/Qt5.1 to enable QtQuick2 testing
|
||||
for targ, qVer in {Targets.DESKTOP_480_GCC:"1.1"}.items(): # Targets.DESKTOP_501_DEFAULT:2}.items():
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
workingDir = tempDir()
|
||||
checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=targ,
|
||||
qtQuickVersion=qVer)
|
||||
test.log("Building project Qt Quick %d Application (%s)"
|
||||
test.log("Building project Qt Quick %s Application (%s)"
|
||||
% (qVer, Targets.getStringForTarget(targ)))
|
||||
result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223)
|
||||
invokeMenuItem("Build", "Build All")
|
||||
@@ -53,7 +54,7 @@ def main():
|
||||
allowAppThroughWinFW(workingDir, projectName)
|
||||
if result:
|
||||
result = runAndCloseApp(True, projectName, 11223,
|
||||
"subprocessFunctionQuick%d" % qVer,
|
||||
"subprocessFunctionQuick%s" % qVer[0],
|
||||
SubprocessType.QT_QUICK_APPLICATION, quickVersion=qVer)
|
||||
else:
|
||||
result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION)
|
||||
|
||||
@@ -33,11 +33,11 @@ def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
for quickVersion in [1, 2]:
|
||||
for quickVersion in ["1.1"]:#, "2.1", "2.2"]: # TODO add Qt5.2 and/or Qt5.1 kit to enable these
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
workingDir = tempDir()
|
||||
projectName = createNewQtQuickUI(workingDir, quickVersion)
|
||||
test.log("Running project Qt Quick %d UI" % quickVersion)
|
||||
test.log("Running project Qt Quick %s UI" % quickVersion)
|
||||
qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(1, workingDir, projectName, 11223, quickVersion)
|
||||
if qmlViewer!=None:
|
||||
qmlViewerPath = os.path.dirname(qmlViewer)
|
||||
|
||||
Reference in New Issue
Block a user