forked from qt-creator/qt-creator
Squish: Update for running tst_generic_highlighter
Change-Id: I262fb7a7223e235708cbc7e8e382a2448a2f8c84 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -190,22 +190,19 @@ def invokeMenuItem(menu, item, *subItems):
|
|||||||
itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
|
itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
|
||||||
waitFor("itemObject.enabled", 2000)
|
waitFor("itemObject.enabled", 2000)
|
||||||
activateItem(itemObject)
|
activateItem(itemObject)
|
||||||
numberedPrefix = "(&\\d \| )?"
|
numberedPrefix = "%d | "
|
||||||
for subItem in subItems:
|
for subItem in subItems:
|
||||||
# we might have numbered sub items (e.g. "Recent Files") - these have this special prefix
|
# we might have numbered sub items (e.g. "Recent Files") - these have this special prefix
|
||||||
if subItem.startswith(numberedPrefix):
|
if subItem.startswith(numberedPrefix):
|
||||||
# TODO: Find fix for Qt 6
|
|
||||||
actions = sub.actions()
|
|
||||||
triggered = False
|
triggered = False
|
||||||
for i in range(actions.count()):
|
for i in range(1, 10):
|
||||||
current = actions.at(i)
|
try:
|
||||||
nonPrefix = subItem[len(numberedPrefix):]
|
itemObject = waitForObjectItem(itemObject, subItem % i, 1000)
|
||||||
matcher = re.match("%s(.*)" % numberedPrefix, str(current.text))
|
|
||||||
if matcher and matcher.group(2) == nonPrefix:
|
|
||||||
itemObject = current
|
|
||||||
activateItem(itemObject)
|
activateItem(itemObject)
|
||||||
triggered = True
|
triggered = True
|
||||||
break
|
break
|
||||||
|
except:
|
||||||
|
continue
|
||||||
if not triggered:
|
if not triggered:
|
||||||
test.fail("Could not trigger '%s' - item missing or code wrong?" % subItem,
|
test.fail("Could not trigger '%s' - item missing or code wrong?" % subItem,
|
||||||
"Function arguments: '%s', '%s', %s" % (menu, item, str(subItems)))
|
"Function arguments: '%s', '%s', %s" % (menu, item, str(subItems)))
|
||||||
|
@@ -199,7 +199,7 @@ def main():
|
|||||||
recentFile = os.path.join(folder, current)
|
recentFile = os.path.join(folder, current)
|
||||||
if recentFile.startswith(home) and platform.system() in ('Linux', 'Darwin'):
|
if recentFile.startswith(home) and platform.system() in ('Linux', 'Darwin'):
|
||||||
recentFile = recentFile.replace(home, "~", 1)
|
recentFile = recentFile.replace(home, "~", 1)
|
||||||
invokeMenuItem("File", "Recent Files", "(&\\d \| )?%s" % recentFile)
|
invokeMenuItem("File", "Recent Files", "%d | " + recentFile)
|
||||||
editor = getEditorForFileSuffix(current)
|
editor = getEditorForFileSuffix(current)
|
||||||
display = displayHintForHighlighterDefinition(current, patterns, lPatterns,
|
display = displayHintForHighlighterDefinition(current, patterns, lPatterns,
|
||||||
addedHaskell, addedLiterateHaskell)
|
addedHaskell, addedLiterateHaskell)
|
||||||
|
Reference in New Issue
Block a user