summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2017-03-02 17:28:00 +0100
committerRobert Loehning <robert.loehning@qt.io>2017-03-03 12:32:36 +0000
commitf78327a571a70f949574294a525cb0ef910c46f1 (patch)
tree1aae25b2fc894486ca560cf7fcd815568849a8a1
parent350db24891a63b00b64439a836435da8b1aafe0b (diff)
downloadqt-creator-f78327a571a70f949574294a525cb0ef910c46f1.tar.gz
Squish: Use list instead of bitfield for kits
Change-Id: Ia2e1f3aa9ea723deb9f2a2c88e2f97be8ae0e833 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--tests/system/shared/classes.py13
-rw-r--r--tests/system/shared/project.py16
-rw-r--r--tests/system/suite_APTW/tst_APTW03/test.py3
-rwxr-xr-xtests/system/suite_CCOM/tst_CCOM01/test.py4
-rw-r--r--tests/system/suite_CSUP/tst_CSUP06/test.py2
-rw-r--r--tests/system/suite_QMLS/tst_QMLS03/test.py2
-rw-r--r--tests/system/suite_debugger/tst_debug_empty_main/test.py3
-rw-r--r--tests/system/suite_debugger/tst_simple_debug/test.py3
-rw-r--r--tests/system/suite_general/tst_build_speedcrunch/test.py2
-rw-r--r--tests/system/suite_general/tst_openqt_creator/test.py4
-rw-r--r--tests/system/suite_general/tst_session_handling/test.py2
-rw-r--r--tests/system/suite_qtquick/tst_qml_outline/test.py2
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation/test.py4
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation4/test.py4
14 files changed, 30 insertions, 34 deletions
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py
index f2e7fcb996..3defd01252 100644
--- a/tests/system/shared/classes.py
+++ b/tests/system/shared/classes.py
@@ -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
@@ -80,14 +81,6 @@ class Targets:
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
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index e8e7a90330..b08384544d 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -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)
diff --git a/tests/system/suite_APTW/tst_APTW03/test.py b/tests/system/suite_APTW/tst_APTW03/test.py
index 36053d2709..1b8090fcdc 100644
--- a/tests/system/suite_APTW/tst_APTW03/test.py
+++ b/tests/system/suite_APTW/tst_APTW03/test.py
@@ -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
diff --git a/tests/system/suite_CCOM/tst_CCOM01/test.py b/tests/system/suite_CCOM/tst_CCOM01/test.py
index d5859c69b5..99d1d33f76 100755
--- a/tests/system/suite_CCOM/tst_CCOM01/test.py
+++ b/tests/system/suite_CCOM/tst_CCOM01/test.py
@@ -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))
diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py
index d721790e7e..0685537199 100644
--- a/tests/system/suite_CSUP/tst_CSUP06/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP06/test.py
@@ -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.")
diff --git a/tests/system/suite_QMLS/tst_QMLS03/test.py b/tests/system/suite_QMLS/tst_QMLS03/test.py
index 9c07a844bc..3682816da5 100644
--- a/tests/system/suite_QMLS/tst_QMLS03/test.py
+++ b/tests/system/suite_QMLS/tst_QMLS03/test.py
@@ -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
diff --git a/tests/system/suite_debugger/tst_debug_empty_main/test.py b/tests/system/suite_debugger/tst_debug_empty_main/test.py
index 39b9ed3018..524499c816 100644
--- a/tests/system/suite_debugger/tst_debug_empty_main/test.py
+++ b/tests/system/suite_debugger/tst_debug_empty_main/test.py
@@ -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))
diff --git a/tests/system/suite_debugger/tst_simple_debug/test.py b/tests/system/suite_debugger/tst_simple_debug/test.py
index 14c250acad..f20069cd2a 100644
--- a/tests/system/suite_debugger/tst_simple_debug/test.py
+++ b/tests/system/suite_debugger/tst_simple_debug/test.py
@@ -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)
diff --git a/tests/system/suite_general/tst_build_speedcrunch/test.py b/tests/system/suite_general/tst_build_speedcrunch/test.py
index 7d6c30227c..d66524001c 100644
--- a/tests/system/suite_general/tst_build_speedcrunch/test.py
+++ b/tests/system/suite_general/tst_build_speedcrunch/test.py
@@ -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")
diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py
index 5722a3fe46..8f838bd4e2 100644
--- a/tests/system/suite_general/tst_openqt_creator/test.py
+++ b/tests/system/suite_general/tst_openqt_creator/test.py
@@ -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)
diff --git a/tests/system/suite_general/tst_session_handling/test.py b/tests/system/suite_general/tst_session_handling/test.py
index 3e11f51a07..0247b6404f 100644
--- a/tests/system/suite_general/tst_session_handling/test.py
+++ b/tests/system/suite_general/tst_session_handling/test.py
@@ -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")
diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py
index e837f52346..383d8296f7 100644
--- a/tests/system/suite_qtquick/tst_qml_outline/test.py
+++ b/tests/system/suite_qtquick/tst_qml_outline/test.py
@@ -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()
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
index c2d349c13b..72ab1e1049 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
@@ -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()
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py
index 99cccb8cd2..a93d9a25ff 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py
@@ -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