forked from qt-creator/qt-creator
Squish: Fix tests for disabled Madde Plugin
Part 2: Fixing evaluation of configured kits depending on available Qt versions as well as determining supported platforms. Additionally enable verifications for Plain C and Plain C++ projects as well. Change-Id: I1f92b44c6771dfc9353b911fdb1ec654c5cc591b Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -441,7 +441,6 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
|
||||
if 'Supported Platforms' in text:
|
||||
supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ")
|
||||
result = []
|
||||
addSimulator = False
|
||||
if 'Desktop' in supports:
|
||||
result.append(QtQuickConstants.Targets.DESKTOP_474_GCC)
|
||||
if platform.system() in ("Linux", "Darwin"):
|
||||
@@ -450,13 +449,12 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
|
||||
result.append(QtQuickConstants.Targets.DESKTOP_474_MSVC2008)
|
||||
if 'MeeGo/Harmattan' in supports:
|
||||
result.append(QtQuickConstants.Targets.HARMATTAN)
|
||||
addSimulator = True
|
||||
if 'Maemo/Fremantle' in supports:
|
||||
result.append(QtQuickConstants.Targets.MAEMO5)
|
||||
addSimulator = True
|
||||
if len(result) == 0 or addSimulator:
|
||||
if not re.search("custom Qt Creator plugin", text):
|
||||
result.append(QtQuickConstants.Targets.SIMULATOR)
|
||||
elif 'Platform independent' in text:
|
||||
# MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not
|
||||
result = [QtQuickConstants.Targets.DESKTOP_474_GCC, QtQuickConstants.Targets.MAEMO5,
|
||||
QtQuickConstants.Targets.SIMULATOR, QtQuickConstants.Targets.HARMATTAN]
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
|
@@ -285,7 +285,7 @@ def __checkParentAccess__(filePath):
|
||||
# this function checks for all configured Qt versions inside
|
||||
# options dialog and returns a dict holding the kits as keys
|
||||
# and a list of information of its configured Qt
|
||||
def getConfiguredKits():
|
||||
def getConfiguredKits(isMaddedDisabled=True):
|
||||
def __retrieveQtVersionName__(target, version):
|
||||
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
|
||||
return treeWidget.currentItem().text(0)
|
||||
@@ -305,7 +305,9 @@ def getConfiguredKits():
|
||||
iterateKits(True, True, __setQtVersionForKit__, kitsWithQtVersionName)
|
||||
# merge defined target names with their configured Qt versions and devices
|
||||
for kit,qtVersion in kitsWithQtVersionName.iteritems():
|
||||
if qtVersion in qtVersionNames:
|
||||
if isMaddedDisabled and kit in ('Fremantle', 'Harmattan') and qtVersion == 'None':
|
||||
test.log("Found Kit '%s' with unassigned Qt version (disabled Madde plugin)" % kit)
|
||||
elif qtVersion in qtVersionNames:
|
||||
result[kit] = targetsQtVersions[qtVersionNames.index(qtVersion)].items()[0]
|
||||
else:
|
||||
test.fail("Qt version '%s' for kit '%s' can't be found in qtVersionNames."
|
||||
|
@@ -21,12 +21,19 @@ def main():
|
||||
catModel = categoriesView.model()
|
||||
projects = catModel.index(0, 0)
|
||||
test.compare("Projects", str(projects.data()))
|
||||
comboBox = waitForObject("{name='comboBox' type='QComboBox' visible='1' "
|
||||
"window=':New_Core::Internal::NewDialog'}")
|
||||
test.compare(comboBox.currentText, "All Templates")
|
||||
comboBox = findObject("{name='comboBox' type='QComboBox' visible='1' "
|
||||
"window=':New_Core::Internal::NewDialog'}")
|
||||
targets = zip(*kits.values())[0]
|
||||
if (QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.MAEMO5) not in targets
|
||||
and QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.HARMATTAN) not in targets):
|
||||
test.compare(comboBox.currentText, "Desktop Templates")
|
||||
test.verify(not comboBox.enabled, "Verifying whether combobox is disabled.")
|
||||
else:
|
||||
test.compare(comboBox.currentText, "All Templates")
|
||||
test.verify(comboBox.enabled, "Verifying whether combobox is enabled.")
|
||||
for category in [item.replace(".", "\\.") for item in dumpItems(catModel, projects)]:
|
||||
# skip non-configurable
|
||||
if "Import" in category or "Non-Qt" in category:
|
||||
if "Import" in category:
|
||||
continue
|
||||
clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton)
|
||||
templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}")
|
||||
@@ -34,7 +41,7 @@ def main():
|
||||
for template in dumpItems(templatesView.model(), templatesView.rootIndex()):
|
||||
template = template.replace(".", "\\.")
|
||||
# skip non-configurable
|
||||
if "Qt Quick 1 UI" in template or "Plain C" in template:
|
||||
if template in ("Qt Quick 1 UI", "Qt Quick 2 UI") or "(CMake Build)" in template:
|
||||
continue
|
||||
availableProjectTypes.append({category:template})
|
||||
clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}"))
|
||||
|
Reference in New Issue
Block a user