Commit f78327a5 authored by Robert Loehning's avatar Robert Loehning

Squish: Use list instead of bitfield for kits

Change-Id: Ia2e1f3aa9ea723deb9f2a2c88e2f97be8ae0e833
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 350db248
......@@ -39,9 +39,10 @@ class Targets:
@staticmethod
def desktopTargetClasses():
desktopTargets = (sum(Targets.ALL_TARGETS) & ~Targets.EMBEDDED_LINUX)
desktopTargets = list(Targets.ALL_TARGETS)
desktopTargets.remove(Targets.EMBEDDED_LINUX)
if platform.system() == 'Darwin':
desktopTargets &= ~Targets.DESKTOP_541_GCC
desktopTargets.remove(Targets.DESKTOP_541_GCC)
return desktopTargets
@staticmethod
......@@ -79,14 +80,6 @@ class Targets:
test.fatal("You've passed at least one unknown target!")
return result
@staticmethod
def intToArray(targets):
return filter(lambda x: x & targets, Targets.ALL_TARGETS)
@staticmethod
def arrayToInt(targetArr):
return reduce(operator.or_, targetArr, 0)
@staticmethod
def getDefaultKit():
return Targets.DESKTOP_531_DEFAULT
......
......@@ -71,8 +71,8 @@ def openCmakeProject(projectPath, buildDir):
invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(projectPath)
__chooseTargets__(0) # uncheck all
__chooseTargets__(Targets.DESKTOP_480_DEFAULT, additionalFunc=additionalFunction)
__chooseTargets__([]) # uncheck all
__chooseTargets__([Targets.DESKTOP_480_DEFAULT], additionalFunc=additionalFunction)
clickButton(waitForObject(":Qt Creator.Configure Project_QPushButton"))
return True
......@@ -326,7 +326,7 @@ def createEmptyQtProject(workingDir=None, projectName=None, targets=Targets.desk
__createProjectHandleLastPage__()
return projectName, checkedTargets
def createNewNonQtProject(workingDir=None, projectName=None, target=Targets.DESKTOP_474_GCC,
def createNewNonQtProject(workingDir=None, projectName=None, target=[Targets.DESKTOP_474_GCC],
plainC=False, cmake=False, qbs=False):
if plainC:
template = "Plain C Application"
......@@ -355,7 +355,7 @@ def createNewNonQtProject(workingDir=None, projectName=None, target=Targets.DESK
return projectName
def createNewCPPLib(projectDir = None, projectName = None, className = None, fromWelcome = False,
target = Targets.DESKTOP_474_GCC, isStatic = False, modules = ["QtCore"]):
target = [Targets.DESKTOP_474_GCC], isStatic = False, modules = ["QtCore"]):
available = __createProjectOrFileSelectType__(" Library", "C++ Library", fromWelcome, True)
if isStatic:
libType = LibType.STATIC
......@@ -373,7 +373,7 @@ def createNewCPPLib(projectDir = None, projectName = None, className = None, fro
return checkedTargets, projectName, className
def createNewQtPlugin(projectDir=None, projectName=None, className=None, fromWelcome=False,
target=Targets.DESKTOP_474_GCC, baseClass="QGenericPlugin"):
target=[Targets.DESKTOP_474_GCC], baseClass="QGenericPlugin"):
available = __createProjectOrFileSelectType__(" Library", "C++ Library", fromWelcome, True)
if projectDir == None:
projectDir = tempDir()
......@@ -385,13 +385,13 @@ def createNewQtPlugin(projectDir=None, projectName=None, className=None, fromWel
__createProjectHandleLastPage__()
return checkedTargets, projectName, className
# parameter target can be an OR'd value of Targets
# parameter target can be a list of Targets
# parameter availableTargets should be the result of __createProjectOrFileSelectType__()
# or use None as a fallback
# parameter additionalFunc function to be executed inside the detailed view of each chosen kit
# if present, 'Details' button will be clicked, function will be executed,
# 'Details' button will be clicked again
def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None, additionalFunc=None):
def __chooseTargets__(targets=[Targets.DESKTOP_474_GCC], availableTargets=None, additionalFunc=None):
if availableTargets != None:
available = availableTargets
else:
......@@ -403,7 +403,7 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None, ad
available.remove(Targets.DESKTOP_541_GCC)
checkedTargets = []
for current in available:
mustCheck = targets & current == current
mustCheck = current in targets
try:
ensureChecked("{type='QCheckBox' text='%s' visible='1'}" % Targets.getStringForTarget(current),
mustCheck, 3000)
......
......@@ -80,7 +80,8 @@ def main():
checkSimpleCppLib("SampleApp2", True)
# Qt Plugin needs Qt4.8 for QGenericPlugin which is tested by default
targets = Targets.desktopTargetClasses() & ~Targets.DESKTOP_474_GCC
targets = Targets.desktopTargetClasses()
targets.remove(Targets.DESKTOP_474_GCC)
checkedTargets, projectName, className = createNewQtPlugin(tempDir(), "SampleApp3", "MyPlugin",
target=targets)
virtualFunctionsAdded = False
......
......@@ -40,7 +40,9 @@ def main():
if not startedWithoutPluginError():
return
# open example project, supports only Qt 5
targets = Targets.desktopTargetClasses() & ~Targets.DESKTOP_474_GCC & ~Targets.DESKTOP_480_DEFAULT
targets = Targets.desktopTargetClasses()
targets.remove(Targets.DESKTOP_474_GCC)
targets.remove(Targets.DESKTOP_480_DEFAULT)
checkedTargets = openQmakeProject(examplePath, targets)
# build and wait until finished - on all build configurations
availableConfigs = iterateBuildConfigs(len(checkedTargets))
......
......@@ -174,7 +174,7 @@ def main():
for useClang in [False, True]:
if not startCreator(useClang):
continue
openQmakeProject(examplePath, Targets.DESKTOP_531_DEFAULT)
openQmakeProject(examplePath, [Targets.DESKTOP_531_DEFAULT])
checkCodeModelSettings(useClang)
if not openDocument("cplusplus-tools.Sources.main\\.cpp"):
earlyExit("Failed to open main.cpp.")
......
......@@ -80,7 +80,7 @@ def main():
if not startedWithoutPluginError():
return
# open example project
openQmakeProject(examplePath, Targets.DESKTOP_531_DEFAULT)
openQmakeProject(examplePath, [Targets.DESKTOP_531_DEFAULT])
# open qml file
openDocument("animation.Resources.animation\\.qrc./animation.basics.color-animation\\.qml")
# get editor
......
......@@ -58,13 +58,12 @@ def main():
performDebugging(projectName, checkedTargets)
invokeMenuItem("File", "Close All Projects and Editors")
# C/C++
targets = Targets.intToArray(Targets.desktopTargetClasses())
for name,isC in {"C":True, "CPP":False}.items():
for singleTarget in targets:
workingDir = tempDir()
qtVersion = re.search("\d{3}", Targets.getStringForTarget(singleTarget)).group()
projectName = createNewNonQtProject(workingDir, "Sample%s%s" % (name, qtVersion),
singleTarget, isC)
[singleTarget], isC)
if projectName == None:
test.fail("Failed to create Sample%s%s" % (name, qtVersion),
"Target: %s, plainC: %s" % (Targets.getStringForTargt(singleTarget), isC))
......
......@@ -30,7 +30,8 @@ def main():
if not startedWithoutPluginError():
return
# Requires Qt 4.8
targets = Targets.desktopTargetClasses() & ~Targets.DESKTOP_474_GCC
targets = Targets.desktopTargetClasses()
targets.remove(Targets.DESKTOP_474_GCC)
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=targets)
......
......@@ -42,7 +42,7 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
checkedTargets = openQmakeProject(SpeedCrunchPath, Targets.DESKTOP_480_DEFAULT)
checkedTargets = openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_480_DEFAULT])
progressBarWait(30000)
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
......
......@@ -36,12 +36,12 @@ def main():
return
runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton')
openQmakeProject(pathSpeedcrunch, Targets.DESKTOP_480_DEFAULT)
openQmakeProject(pathSpeedcrunch, [Targets.DESKTOP_480_DEFAULT])
# Wait for parsing to complete
waitFor("runButton.enabled", 30000)
# Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)
startopening = datetime.utcnow()
openQmakeProject(pathCreator, Targets.DESKTOP_561_DEFAULT)
openQmakeProject(pathCreator, [Targets.DESKTOP_561_DEFAULT])
# Wait for parsing to complete
startreading = datetime.utcnow()
waitFor("runButton.enabled", 300000)
......
......@@ -39,7 +39,7 @@ def main():
"Verifying window title contains created session name.")
checkWelcomePage(sessionName, True)
for project in projects:
openQmakeProject(project, Targets.DESKTOP_531_DEFAULT)
openQmakeProject(project, [Targets.DESKTOP_531_DEFAULT])
progressBarWait(20000)
checkNavigator(53, "Verifying whether all projects have been opened.")
openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml")
......
......@@ -39,7 +39,7 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
openQmakeProject(os.path.join(templateDir, proFile), Targets.DESKTOP_531_DEFAULT)
openQmakeProject(os.path.join(templateDir, proFile), [Targets.DESKTOP_531_DEFAULT])
qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"]
checkOutlineFor(qmlFiles)
testModify()
......
......@@ -36,10 +36,10 @@ def main():
for qtVersion, controls in available:
if qtVersion == "5.3":
targ = Targets.DESKTOP_531_DEFAULT
targ = [Targets.DESKTOP_531_DEFAULT]
quick = "2.3"
else:
targ = Targets.DESKTOP_541_GCC
targ = [Targets.DESKTOP_541_GCC]
quick = "2.4"
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
......
......@@ -29,8 +29,8 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
for targ, quickVer in [[Targets.DESKTOP_480_DEFAULT, 1], [Targets.DESKTOP_561_DEFAULT, 2],
[Targets.DESKTOP_531_DEFAULT, 2]]:
for targ, quickVer in [[[Targets.DESKTOP_480_DEFAULT], 1], [[Targets.DESKTOP_561_DEFAULT], 2],
[[Targets.DESKTOP_531_DEFAULT], 2]]:
# using a temporary directory won't mess up a potentially existing
createNewQmlExtension(tempDir(), targ, quickVer)
# wait for parsing to complete
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment