Squish: Run tst_CSUP04 with Clang code model, too

Change-Id: I3a2f029e0f1c85ecbd3c161b097f4e975014f714
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Robert Loehning
2014-09-25 12:13:23 +02:00
parent 4957137ef6
commit 6447eb9cbf

View File

@@ -39,44 +39,48 @@ def main():
# copy example project to temp directory # copy example project to temp directory
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
examplePath = os.path.join(templateDir, proFile) examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath) startCreatorTryingClang()
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
# open example project # open example project
openQmakeProject(examplePath) openQmakeProject(examplePath)
# wait for parsing to complete # wait for parsing to complete
progressBarWait(30000) progressBarWait(30000)
# open .cpp file in editor models = iterateAvailableCodeModels()
if not openDocument("propertyanimation.Sources.main\\.cpp"): for current in models:
test.fatal("Could not open main.cpp") if current != models[0]:
invokeMenuItem("File", "Exit") selectCodeModel(current)
return test.log("Testing code model: %s" % current)
test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), # open .cpp file in editor
"Verifying if: .cpp file is opened in Edit mode.") if not openDocument("propertyanimation.Sources.main\\.cpp"):
# place cursor on line "QmlApplicationViewer viewer;" test.fatal("Could not open main.cpp")
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") invokeMenuItem("File", "Exit")
# invoke find usages from context menu on word "viewer" return
if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "<Left>", 10): test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
invokeMenuItem("File", "Exit") "Verifying if: .cpp file is opened in Edit mode.")
return # place cursor on line "QmlApplicationViewer viewer;"
# wait until search finished and verify search results editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
waitForSearchResults() # invoke find usages from context menu on word "viewer"
validateSearchResult(14) if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "<Left>", 10):
result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) invokeMenuItem("File", "Exit")
test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " return
"File with used text is opened.") # wait until search finished and verify search results
# move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U. waitForSearchResults()
openDocument("propertyanimation.Sources.main\\.cpp") validateSearchResult(14)
if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"): result = re.search("QmlApplicationViewer", str(editorWidget.plainText))
return test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. "
for i in range(4): "File with used text is opened.")
type(editorWidget, "<Left>") # move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U.
type(editorWidget, "<Ctrl+Shift+u>") openDocument("propertyanimation.Sources.main\\.cpp")
# wait until search finished and verify search results if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"):
waitForSearchResults() return
validateSearchResult(3) for i in range(4):
# exit qt creator type(editorWidget, "<Left>")
invokeMenuItem("File", "Save All") type(editorWidget, "<Ctrl+Shift+u>")
# wait until search finished and verify search results
waitForSearchResults()
validateSearchResult(3)
invokeMenuItem("File", "Close All")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
def waitForSearchResults(): def waitForSearchResults():