Squish: Refactor starting Qt Creator from Squish

Change-Id: I7cbce7db2a22a7cb327965b9b7918eb46266b260
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2018-08-22 14:37:34 +02:00
parent c30b629b52
commit 1016dc0603
71 changed files with 91 additions and 112 deletions

View File

@@ -23,10 +23,11 @@
#
############################################################################
def startCreatorTryingClang():
def startCreatorVerifyingClang(useClang):
try:
# start Qt Creator with enabled ClangCodeModel plugin (without modifying settings)
startApplication("qtcreator -load ClangCodeModel" + SettingsPath)
# start Qt Creator with / without enabled ClangCodeModel plugin (without modifying settings)
loadOrNoLoad = '-load' if useClang else '-noload'
startQC([loadOrNoLoad, 'ClangCodeModel'])
except RuntimeError:
t, v = sys.exc_info()[:2]
strv = str(v)
@@ -35,26 +36,17 @@ def startCreatorTryingClang():
else:
test.fatal("Exception caught", "%s(%s)" % (str(t), strv))
return False
if platform.system() not in ('Microsoft', 'Windows'): # only Win uses dialogs for this
return startedWithoutPluginError()
errorMsg = "{type='QMessageBox' unnamed='1' visible='1' windowTitle='Qt Creator'}"
errorOK = "{text='OK' type='QPushButton' unnamed='1' visible='1' window=%s}" % errorMsg
if not waitFor("object.exists(errorOK)", 5000):
return True
return startedWithoutPluginError()
clickButton(errorOK) # Error message
clickButton(errorOK) # Help message
test.fatal("ClangCodeModel plugin not available.")
return False
def startCreator(useClang):
try:
if useClang:
if not startCreatorTryingClang():
return False
else:
startApplication("qtcreator -noload ClangCodeModel" + SettingsPath)
finally:
overrideStartApplication()
return startedWithoutPluginError()
def __openCodeModelOptions__():
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "C++")