Squish: Verify targets for project creation

Change-Id: I3af0e0cde985c4b04bd4ae8181c3b82cda22b2b8
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
This commit is contained in:
Christian Stenger
2012-02-17 17:10:53 +01:00
parent 24aa17e318
commit 3ad7e50827
7 changed files with 205 additions and 5 deletions

View File

@@ -260,3 +260,37 @@ def __checkParentAccess__(filePath):
test.log("Got execute permission on '%s'" % tmp)
else:
test.fail("No execute permission on '%s'" % tmp)
# this function checks for all configured Qt versions inside
# options dialog and returns a dict holding the targets as keys
# and a list of supported versions as value
def getCorrectlyConfiguredTargets():
result = {}
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Build & Run")
clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Qt Versions")
pattern = re.compile("Qt version (?P<version>.*?) for (?P<target>.*)")
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
root = treeWidget.invisibleRootItem()
for childRow in range(root.childCount()):
rootChild = root.child(childRow)
rootChildText = str(rootChild.text(0)).replace(".", "\\.")
for row in range(rootChild.childCount()):
subChild = rootChild.child(row)
subChildText = str(subChild.text(0)).replace(".", "\\.")
clickItem(treeWidget, ".".join([rootChildText,subChildText]), 5, 5, 0, Qt.LeftButton)
currentText = str(waitForObject(":QtSupport__Internal__QtVersionManager.QLabel").text)
matches = pattern.match(currentText)
if matches:
target = matches.group("target")
version = matches.group("version")
if target in result:
oldV = result[target]
if version not in oldV:
oldV.append(version)
result.update({target:oldV})
else:
result.update({target:[version]})
clickButton(waitForObject(":Options.OK_QPushButton"))
return result