Skip to content
Snippets Groups Projects
Commit efa91f00 authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Fix for renaming Targets to Kits


Change-Id: Ia3faec39499bc7e65d5d0a0fb7963fcb4016c6d5
Reviewed-by: default avatarRobert Loehning <robert.loehning@nokia.com>
parent 948abf10
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@
:Edit Environment_ProjectExplorer::EnvironmentItemsDialog {type='ProjectExplorer::EnvironmentItemsDialog' unnamed='1' visible='1' windowTitle='Edit Environment'}
:Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'}
:Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:Kits_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='4' type='QComboBox' unnamed='1' visible='1'}
:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
:New_Core::Internal::NewDialog {name='Core__Internal__NewDialog' type='Core::Internal::NewDialog' visible='1' windowTitle='New'}
......@@ -57,8 +59,6 @@
:QtSupport__Internal__QtVersionManager.qmake_QLabel {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='qmakePath' type='QLabel' visible='1'}
:QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='qtdirList' type='QTreeWidget' visible='1'}
:Symbol Server_Utils::CheckableMessageBox {type='Utils::CheckableMessageBox' unnamed='1' visible='1' windowTitle='Symbol Server'}
:Targets_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
:Targets_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='4' type='QComboBox' unnamed='1' visible='1'}
:addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'}
:formFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Form file:_QLabel' name='formFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:frame.templateDescription_QTextBrowser {container=':New.frame_QFrame' name='templateDescription' type='QTextBrowser' visible='1'}
......
......@@ -146,26 +146,26 @@ def getQtInformationForBuildSettings(alreadyOnProjectsBuildSettings=False, after
def getQtInformationForQmlProject():
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
target = __getTargetFromToolTip__(str(fancyToolButton.toolTip))
if not target:
test.fatal("Could not figure out which target you're using...")
kit = __getTargetFromToolTip__(str(fancyToolButton.toolTip))
if not kit:
test.fatal("Could not figure out which kit you're using...")
return None, None, None, None
test.log("Searching for Qt information for target '%s'" % target)
test.log("Searching for Qt information for kit '%s'" % kit)
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"), "Targets")
targetsTreeView = waitForObject(":Targets_QTreeView")
if not __selectTreeItemOnBuildAndRun__(targetsTreeView, "%s(\s\(default\))?" % target, True):
test.fatal("Found no matching target - this shouldn't happen.")
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits")
targetsTreeView = waitForObject(":Kits_QTreeView")
if not __selectTreeItemOnBuildAndRun__(targetsTreeView, "%s(\s\(default\))?" % kit, True):
test.fatal("Found no matching kit - this shouldn't happen.")
clickButton(waitForObject(":Options.Cancel_QPushButton"))
return None, None, None, None
qtVersionStr = str(waitForObject(":Targets_QtVersion_QComboBox").currentText)
test.log("Target '%s' uses Qt Version '%s'" % (target, qtVersionStr))
qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText)
test.log("Kit '%s' uses Qt Version '%s'" % (kit, qtVersionStr))
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Qt Versions")
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
if not __selectTreeItemOnBuildAndRun__(treeWidget, qtVersionStr):
test.fatal("Found no matching Qt Version for target - this shouldn't happen.")
test.fatal("Found no matching Qt Version for kit - this shouldn't happen.")
clickButton(waitForObject(":Options.Cancel_QPushButton"))
return None, None, None, None
qmake = str(waitForObject(":QtSupport__Internal__QtVersionManager.qmake_QLabel").text)
......@@ -179,12 +179,11 @@ def getQtInformationForQmlProject():
def __selectTreeItemOnBuildAndRun__(treeViewOrWidget, itemText, isRegex=False):
model = treeViewOrWidget.model()
test.compare(model.rowCount(), 2, "Verifying expected target section count")
test.compare(model.rowCount(), 2, "Verifying expected section count")
autoDetected = model.index(0, 0)
test.compare(autoDetected.data().toString(), "Auto-detected",
"Verifying label for target section")
test.compare(autoDetected.data().toString(), "Auto-detected", "Verifying label for section")
manual = model.index(1, 0)
test.compare(manual.data().toString(), "Manual", "Verifying label for target section")
test.compare(manual.data().toString(), "Manual", "Verifying label for section")
if isRegex:
pattern = re.compile(itemText)
found = False
......
......@@ -283,17 +283,17 @@ def __checkParentAccess__(filePath):
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():
# options dialog and returns a dict holding the kits as keys
# and a list of information of its configured Qt
def getConfiguredKits():
def __retrieveQtVersionName__(target, version):
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
return treeWidget.currentItem().text(0)
targetQtVersionNames = {}
result = {}
targetsQtVersions, qtVersionNames = iterateQtVersions(True, __retrieveQtVersionName__)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Targets")
treeView = waitForObject(":Targets_QTreeView")
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Kits")
treeView = waitForObject(":Kits_QTreeView")
model = treeView.model()
test.compare(model.rowCount(), 2, "Verifying expected target section count")
autoDetected = model.index(0, 0)
......@@ -309,7 +309,7 @@ def getCorrectlyConfiguredTargets():
item = ".".join([str(section.data().toString()),
str(index.data().toString()).replace(".", "\\.")])
clickItem(treeView, item, 5, 5, 0, Qt.LeftButton)
qtVersionStr = str(waitForObject(":Targets_QtVersion_QComboBox").currentText)
qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText)
targetQtVersionNames[targetName] = qtVersionStr
# merge defined target names with their configured Qt versions and devices
for target,qtVersion in targetQtVersionNames.iteritems():
......@@ -321,7 +321,7 @@ def getCorrectlyConfiguredTargets():
if targetInfo[0] == "Maemo":
result.update({targetName:
(QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.MAEMO5), targetInfo[1])})
test.log("Correctly configured targets: %s" % str(result))
test.log("Configured kits: %s" % str(result))
return result
def visibleCheckBoxExists(text):
......
......@@ -12,7 +12,7 @@ def main():
overrideInstallLazySignalHandler()
installLazySignalHandler(":frame.templateDescription_QTextBrowser",
"textChanged()","__handleTextChanged__")
targets = getCorrectlyConfiguredTargets()
kits = getConfiguredKits()
test.log("Collecting potential project types...")
availableProjectTypes = []
invokeMenuItem("File", "New File or Project...")
......@@ -69,38 +69,39 @@ def main():
clickButton(waitForObject(":Next_QPushButton"))
except LookupError:
pass
waitForObject("{type='QLabel' unnamed='1' visible='1' text='Target Setup'}")
availableCheckboxes = filter(visibleCheckBoxExists, targets.keys())
waitForObject("{type='QLabel' unnamed='1' visible='1' text='Kit Selection'}")
availableCheckboxes = filter(visibleCheckBoxExists, kits.keys())
JIRA.performWorkaroundIfStillOpen(6994, JIRA.Bug.CREATOR, template, displayedPlatforms)
# verification whether expected, found and configured match
for t in targets:
for t in kits:
if requiredVersion:
if targets[t][1] < requiredVersion:
if kits[t][1] < requiredVersion:
if t in availableCheckboxes:
test.fail("Target '%s' found as checkbox, but required version (%s) is higher "
"than configured version (%s)!" % (t, requiredVersion,
str(targets[t][1])))
test.fail("Kit '%s' found as checkbox, but required Qt version (%s) is "
"higher than configured Qt version (%s)!" % (t, requiredVersion,
str(kits[t][1])))
availableCheckboxes.remove(t)
else:
test.passes("Irrelevant target '%s' not found on 'Target setup' page - "
"required version is '%s', current version is '%s'." %
(t, requiredVersion, str(targets[t][1])))
test.passes("Irrelevant kit '%s' not found on 'Kit Selection' page - "
"required Qt version is '%s', current Qt version is '%s'." %
(t, requiredVersion, str(kits[t][1])))
continue
found = False
if targets[t][0] in displayedPlatforms:
if kits[t][0] in displayedPlatforms:
if t in availableCheckboxes:
test.passes("Found expected target '%s' on 'Target setup' page." % t)
test.passes("Found expected kit '%s' on 'Kit Selection' page." % t)
availableCheckboxes.remove(t)
else:
test.fail("Expected target '%s' missing on 'Target setup' page." % t)
test.fail("Expected kit '%s' missing on 'Kit Selection' page." % t)
else:
if t in availableCheckboxes:
test.fail("Target '%s' found on 'Target setup' page - but has not been expected!" % t)
test.fail("Kit '%s' found on 'Kit Selection' page - but was not expected!" % t)
else:
test.passes("Irrelevant target '%s' not found on 'Target setup' page." % t)
test.passes("Irrelevant kit '%s' not found on 'Kit Selection' page." % t)
if len(availableCheckboxes) != 0:
test.fail("Found unexpected additional target(s) %s on 'Target setup' page." % str(availableCheckboxes))
clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}", 20000))
test.fail("Found unexpected additional kit(s) %s on 'Kit Selection' page."
% str(availableCheckboxes))
clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}"))
invokeMenuItem("File", "Exit")
def cleanup():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment