Squish: Fix determination of available targets

Change-Id: Iff01b44058dd9175aacfb0a0da96f35fb32383e7
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
Christian Stenger
2013-08-26 11:17:33 +02:00
parent 4fc9302c56
commit cdf8407d67
2 changed files with 9 additions and 21 deletions

View File

@@ -480,18 +480,19 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ") supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ")
result = [] result = []
if 'Desktop' in supports: if 'Desktop' in supports:
result.append(Targets.DESKTOP_474_GCC) if version == None or version < "5.0":
result.append(Targets.DESKTOP_480_GCC) result.append(Targets.DESKTOP_474_GCC)
result.append(Targets.DESKTOP_480_GCC)
if platform.system() in ("Linux", "Darwin"):
result.append(Targets.EMBEDDED_LINUX)
elif platform.system() in ('Windows', 'Microsoft'):
result.append(Targets.DESKTOP_480_MSVC2010)
result.append(Targets.DESKTOP_501_DEFAULT) result.append(Targets.DESKTOP_501_DEFAULT)
if platform.system() in ("Linux", "Darwin"):
result.append(Targets.EMBEDDED_LINUX)
elif platform.system() in ('Windows', 'Microsoft'):
result.append(Targets.DESKTOP_480_MSVC2010)
if 'MeeGo/Harmattan' in supports: if 'MeeGo/Harmattan' in supports:
result.append(Targets.HARMATTAN) result.append(Targets.HARMATTAN)
if 'Maemo/Fremantle' in supports: if 'Maemo/Fremantle' in supports:
result.append(Targets.MAEMO5) result.append(Targets.MAEMO5)
if not re.search("custom Qt Creator plugin", text): if not re.search("custom Qt Creator plugin", text) and (version == None or version < "5.0"):
result.append(Targets.SIMULATOR) result.append(Targets.SIMULATOR)
elif 'Platform independent' in text: elif 'Platform independent' in text:
# MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not # MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not

View File

@@ -101,7 +101,7 @@ def performTest(templateDir, qmlFile, isMaddeDisabled):
clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton) clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton)
waitFor("textChanged", 2000) waitFor("textChanged", 2000)
text = waitForObject(":frame.templateDescription_QTextBrowser").plainText text = waitForObject(":frame.templateDescription_QTextBrowser").plainText
displayedPlatforms, requiredVersion = __getSupportedPlatforms__(str(text), True) displayedPlatforms = __getSupportedPlatforms__(str(text), True)[0]
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}")) clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}"))
# don't check because project could exist # don't check because project could exist
__createProjectSetNameAndPath__(os.path.expanduser("~"), 'untitled', False) __createProjectSetNameAndPath__(os.path.expanduser("~"), 'untitled', False)
@@ -120,19 +120,6 @@ def performTest(templateDir, qmlFile, isMaddeDisabled):
availableCheckboxes = filter(visibleCheckBoxExists, kits.keys()) availableCheckboxes = filter(visibleCheckBoxExists, kits.keys())
# verification whether expected, found and configured match # verification whether expected, found and configured match
for t in kits: for t in kits:
if requiredVersion:
if kits[t][1] < requiredVersion:
if t in availableCheckboxes:
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 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 t in displayedPlatforms: if t in displayedPlatforms:
if t in availableCheckboxes: if t in availableCheckboxes:
test.passes("Found expected kit '%s' on 'Kit Selection' page." % t) test.passes("Found expected kit '%s' on 'Kit Selection' page." % t)