Commit 86d3e075 authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: catch plugin loader error if it occurs



...and stop execution of the current test case

Change-Id: I46ac21e79f643f6890b7303d08c204dcd9fa9386
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 5ceeddf2
......@@ -42,6 +42,21 @@ def overrideStartApplication():
test.log("Using workaround for MacOS (different AUT name)")
return __origStartApplication__(*args)
def startedWithoutPluginError():
try:
loaderErrorWidgetName = ("{name='ExtensionSystem__Internal__PluginErrorOverview' "
"type='ExtensionSystem::PluginErrorOverview' visible='1' "
"windowTitle='Qt Creator - Plugin loader messages'}")
loaderError = waitForObject(loaderErrorWidgetName, 1000)
test.fatal("Could not perform clean start of Qt Creator - Plugin error occurred.",
waitForObject("{name='pluginError' type='QTextEdit' visible='1' window=%s}"
% loaderErrorWidgetName, 1000).plainText)
clickButton("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}")
invokeMenuItem("File", "Exit")
return False
except:
return True
def waitForCleanShutdown(timeOut=10):
appCtxt = currentApplicationContext()
shutdownDone = (str(appCtxt)=="")
......
......@@ -5,6 +5,8 @@ source("../shared/aptw.py")
# test New Qt Gui Application build and run for release and debug option
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
checkedTargets = createProject_Qt_GUI(tempDir(), "SampleApp")
# run project for debug and release and verify results
runVerify(checkedTargets)
......
......@@ -5,6 +5,8 @@ source("../shared/aptw.py")
# test New Qt Quick Application build and run for release and debug option
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
checkedTargets, projectName = createNewQtQuickApplication(tempDir(), "SampleApp")
# run project for debug and release and verify results
runVerify(checkedTargets)
......
......@@ -12,6 +12,8 @@ def main():
templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# open example project
checkedTargets = openQmakeProject(examplePath)
# build and wait until finished - on all build configurations
......
......@@ -12,6 +12,8 @@ def main():
templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# open example project
openQmakeProject(examplePath)
# create syntax error
......
......@@ -4,6 +4,8 @@ source("../../shared/qtcreator.py")
# entry of test
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# create qt quick application
# Step 1: Open test .pro project.
createNewQtQuickApplication(tempDir(), "SampleApp")
......
......@@ -4,6 +4,8 @@ source("../../shared/qtcreator.py")
# entry of test
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# create qt quick application
# Step 1: Open test .pro project.
createNewQtQuickApplication(tempDir(), "SampleApp")
......
......@@ -13,6 +13,8 @@ def main():
templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# open example project
openQmakeProject(examplePath)
installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__")
......
......@@ -12,6 +12,8 @@ def main():
templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# open example project
openQmakeProject(examplePath)
# wait for parsing to complete
......
......@@ -33,6 +33,8 @@ def main():
test.fatal("Can't find version from file.")
return
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
if platform.system() == "Darwin":
invokeMenuItem("Help", "About Qt Creator")
else:
......
......@@ -43,6 +43,8 @@ def main():
global textHasChanged
noMatch = "Your search did not match any documents."
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
installLazySignalHandler(":Qt Creator_Help::Internal::HelpViewer", "textChanged()", "__handleTextChanged__")
addHelpDocumentationFromSDK()
# switch to help mode
......
......@@ -20,6 +20,8 @@ def verifyInteractiveQMLHelp(lineText, helpText):
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
addHelpDocumentationFromSDK()
# create qt quick application
createNewQtQuickApplication(tempDir(), "SampleApp")
......
......@@ -18,6 +18,8 @@ def getQModelIndexStr(textProperty, container):
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# goto help mode and click on topic
switchViewTo(ViewConstants.HELP)
manualQModelIndex = getQModelIndexStr("text?='Qt Creator Manual *'",
......
......@@ -3,6 +3,8 @@ source("../../shared/suites_qtta.py")
def startQtCreatorWithNewAppAtQMLEditor(projectDir, projectName, line = None):
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return None
# create qt quick application
createNewQtQuickApplication(projectDir, projectName)
# open qml file
......
......@@ -47,6 +47,8 @@ def main():
templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# open example project
openQmakeProject(examplePath)
# open qml file
......
......@@ -4,6 +4,8 @@ source("../../shared/suites_qtta.py")
# entry of test
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# create qt quick application
checkedTargets, projectName = createNewQtQuickApplication(tempDir(), "SampleApp")
# build it - on all build configurations
......
......@@ -4,6 +4,8 @@ source("../../shared/suites_qtta.py")
# entry of test
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# create qt quick application
createNewQtQuickApplication(tempDir(), "SampleApp")
# create syntax error in qml file
......
......@@ -7,6 +7,8 @@ def main():
expectedErrorAlternatives = ["'SyntaxError' was not declared in this scope",
"'SyntaxError' : undeclared identifier"]
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# create qt quick application
checkedTargets, projectName = createNewQtQuickApplication(tempDir(), "SampleApp")
# create syntax error in cpp file
......
......@@ -26,6 +26,8 @@ def main():
projectName1 = "SampleApp1"
projectName2 = "SampleApp2"
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
# create qt quick application 1
createNewQtQuickApplication(tempDir(), projectName1)
# create qt quick application 2
......
......@@ -28,6 +28,8 @@ def main():
global webPageContentLoadedValue, gettingStartedText
# open Qt Creator
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
installLazySignalHandler(":QWebPage","loadFinished(bool)", "webPageContentLoaded")
installLazySignalHandler(":*Qt Creator_Help::Internal::HelpViewer", "loadFinished(bool)",
"webPageContentLoaded")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment