forked from qt-creator/qt-creator
Squish: catch plugin loader error if it occurs
...and stop execution of the current test case Change-Id: I46ac21e79f643f6890b7303d08c204dcd9fa9386 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -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")
|
||||
|
@@ -9,6 +9,8 @@ def main():
|
||||
return
|
||||
# open Qt Creator
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
if not test.verify(checkIfObjectExists(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
|
||||
"text='Getting Started'")),
|
||||
"Verifying: Qt Creator displays Welcome Page with Getting Started."):
|
||||
|
@@ -37,6 +37,8 @@ def main():
|
||||
return
|
||||
# open Qt Creator
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
installLazySignalHandler(":QWebPage","loadFinished(bool)", "webPageContentLoaded")
|
||||
installLazySignalHandler(":*Qt Creator_Help::Internal::HelpViewer", "loadFinished(bool)",
|
||||
"webPageContentLoaded")
|
||||
|
@@ -4,6 +4,8 @@ source("../../shared/suites_qtta.py")
|
||||
def main():
|
||||
# open Qt Creator
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
if not test.verify(checkIfObjectExists(getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
|
||||
"text='Getting Started'")),
|
||||
"Verifying: Qt Creator displays Welcome Page with Getting Started."):
|
||||
|
@@ -4,6 +4,8 @@ project = "SquishProject"
|
||||
|
||||
def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
checkedTargets = createProject_Qt_Console(tempDir(), project)
|
||||
availableConfigs = iterateBuildConfigs(len(checkedTargets))
|
||||
if not availableConfigs:
|
||||
|
@@ -15,6 +15,8 @@ def main():
|
||||
outputStdOut = "Output from std::cout."
|
||||
outputStdErr = "Output from std::cerr."
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
installLazySignalHandler("{type='ProjectExplorer::Internal::ProjectExplorerPlugin' unnamed='1'}",
|
||||
"runControlFinished(ProjectExplorer::RunControl*)", "__handlerunControlFinished__")
|
||||
checkedTargets = createProject_Qt_Console(tempDir(), project)
|
||||
|
@@ -5,6 +5,8 @@ workingDir = None
|
||||
def main():
|
||||
global workingDir
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
targets = [QtQuickConstants.Targets.DESKTOP_474_GCC]
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
targets.append(QtQuickConstants.Targets.DESKTOP_474_MSVC2008)
|
||||
|
@@ -14,6 +14,8 @@ def main():
|
||||
cleanUpUserFiles(proFile)
|
||||
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
overrideInstallLazySignalHandler()
|
||||
installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()",
|
||||
"__handleTextChanged__")
|
||||
|
@@ -26,6 +26,8 @@ def main():
|
||||
files = map(copyToTemplateDir, files)
|
||||
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
for currentFile in files:
|
||||
test.log("Opening file %s" % currentFile)
|
||||
invokeMenuItem("File", "Open File or Project...")
|
||||
|
@@ -2,6 +2,8 @@ source("../../shared/qtcreator.py")
|
||||
|
||||
def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
createProject_Qt_Console(tempDir(), "SquishProject")
|
||||
selectFromLocator("main.cpp")
|
||||
cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||
|
@@ -12,6 +12,8 @@ def main():
|
||||
if not changeFilePermissions(testFolder, True, False, "testfiles.pro"):
|
||||
test.fatal("Could not set permissions for files to read-only - test will likely fail.")
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(os.path.join(testFolder, "testfiles.pro"))
|
||||
modifiedUnsaved = []
|
||||
readOnlyFiles = []
|
||||
|
@@ -10,6 +10,8 @@ def main():
|
||||
if not neededFilePresent(os.path.join(sourceExample, qmlFile)):
|
||||
return
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# add docs to have the correct tool tips
|
||||
addHelpDocumentationFromSDK()
|
||||
templateDir = prepareTemplate(sourceExample)
|
||||
|
@@ -2,6 +2,8 @@ source("../../shared/qtcreator.py")
|
||||
|
||||
def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# using a temporary directory won't mess up a potentially exisiting
|
||||
createNewQtQuickApplication(tempDir(), "untitled")
|
||||
if not prepareQmlFile():
|
||||
|
@@ -11,6 +11,8 @@ def main():
|
||||
return
|
||||
proFile = os.path.join(folder, "testfiles.pro")
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(proFile)
|
||||
if not testRenameMacroAfterSourceModification():
|
||||
return
|
||||
|
@@ -21,6 +21,8 @@ def main():
|
||||
return
|
||||
proFile = os.path.join(folder, "testfiles.pro")
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(proFile)
|
||||
fileModifications = {"testfiles.testfiles\\.pro":__modifyProFile__,
|
||||
"testfiles.Headers.testfile\\.h":__modifyHeader__,
|
||||
|
@@ -17,6 +17,8 @@ def main():
|
||||
return
|
||||
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
for currentFile in files:
|
||||
test.log("Opening file %s" % currentFile)
|
||||
size = charactersInFile(currentFile)
|
||||
|
@@ -15,6 +15,8 @@ def main():
|
||||
if not neededFilePresent(SpeedCrunchPath):
|
||||
return
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
checkedTargets = openQmakeProject(SpeedCrunchPath)
|
||||
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
|
||||
|
||||
|
@@ -14,7 +14,8 @@ def main():
|
||||
return
|
||||
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
result = openCmakeProject(SpeedCrunchPath, BuildPath)
|
||||
if not result:
|
||||
test.fatal("Could not open/create cmake project - leaving test")
|
||||
|
@@ -10,6 +10,8 @@ def main():
|
||||
return
|
||||
templateDir = prepareTemplate(sourceExample)
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
overrideInstallLazySignalHandler()
|
||||
installLazySignalHandler(":frame.templateDescription_QTextBrowser",
|
||||
"textChanged()","__handleTextChanged__")
|
||||
|
@@ -12,6 +12,8 @@ def main():
|
||||
__createMinimumIni__(emptySettings)
|
||||
SettingsPath = ' -settingspath "%s"' % emptySettings
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
invokeMenuItem("Tools", "Options...")
|
||||
__checkBuildAndRun__()
|
||||
clickButton(waitForObject(":Options.Cancel_QPushButton"))
|
||||
|
@@ -4,6 +4,8 @@ def main():
|
||||
for lang in testData.dataset("languages.tsv"):
|
||||
overrideStartApplication()
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
invokeMenuItem("Tools", "Options...")
|
||||
waitForObjectItem(":Options_QListView", "Environment")
|
||||
clickItem(":Options_QListView", "Environment", 14, 15, 0, Qt.LeftButton)
|
||||
|
@@ -7,6 +7,8 @@ def main():
|
||||
return
|
||||
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
|
||||
openQmakeProject(pathSpeedcrunch)
|
||||
# Wait for parsing to complete
|
||||
|
@@ -11,6 +11,8 @@ def main():
|
||||
return
|
||||
templateDir = prepareTemplate(sourceExample)
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(os.path.join(templateDir, proFile))
|
||||
qmlFiles = ["focus.QML.qml.focus\\.qml", "focus.QML.qml.Core.ListMenu\\.qml"]
|
||||
checkOutlineFor(qmlFiles)
|
||||
|
@@ -2,6 +2,8 @@ source("../../shared/qtcreator.py")
|
||||
|
||||
def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
workingDir = tempDir()
|
||||
checkedTargets, projectName = createNewQtQuickApplication(workingDir,
|
||||
|
@@ -6,6 +6,8 @@ def main():
|
||||
if not neededFilePresent(os.path.join(sourceExample, qmlFile)):
|
||||
return
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
workingDir = tempDir()
|
||||
checkedTargets, projectName = createNewQtQuickApplication(workingDir, None,
|
||||
|
@@ -2,6 +2,8 @@ source("../../shared/qtcreator.py")
|
||||
|
||||
def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
workingDir = tempDir()
|
||||
projectName = createNewQtQuickUI(workingDir)
|
||||
|
@@ -2,6 +2,8 @@ source("../../shared/qtcreator.py")
|
||||
|
||||
def main():
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
createNewQmlExtension(tempDir())
|
||||
# wait for parsing to complete
|
||||
|
Reference in New Issue
Block a user