Commit 7114ee91 authored by Robert Loehning's avatar Robert Loehning

Squish: Run tst_CSUP01 on clang code model, too

Change-Id: Ic2424cc9d962feff06baadc23a5fdf121bf2a11d
Reviewed-by: default avatarChristian Stenger <>
parent a2342fa4
......@@ -64,12 +64,15 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
return False
# change autocomplete options to manual
def changeAutocompleteToManual():
def changeAutocompleteToManual(toManual=True):
invokeMenuItem("Tools", "Options...")
mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton)
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion")
ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), False)
selectFromCombo(":Behavior.completionTrigger_QComboBox", "Manually")
ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), not toManual)
activateCompletion = "Always"
if toManual:
activateCompletion = "Manually"
selectFromCombo(":Behavior.completionTrigger_QComboBox", activateCompletion)
......@@ -48,12 +48,15 @@ def triggerCompletion(editorWidget):
# entry of test
def main():
startApplication("qtcreator" + SettingsPath)
clangLoaded = startCreatorTryingClang()
if not startedWithoutPluginError():
# create qt quick application
# Step 1: Open test .pro project.
createNewQtQuickApplication(tempDir(), "SampleApp")
for useClang in set([False, clangLoaded]):
selectClangCodeModel(clangLoaded, useClang)
# Step 2: Open .cpp file in Edit mode.
if not openDocument("SampleApp.Sources.main\\.cpp"):
test.fatal("Could not open main.cpp")
......@@ -69,9 +72,9 @@ def main():
type(editorWidget, "<Return>")
type(editorWidget, "re")
waitForObjectItem(":popupFrame_Proposal_QListView", "register")
doubleClickItem(":popupFrame_Proposal_QListView", "register", 5, 5, 0, Qt.LeftButton), "register",
waitForObjectItem(":popupFrame_Proposal_QListView", "realloc")
doubleClickItem(":popupFrame_Proposal_QListView", "realloc", 5, 5, 0, Qt.LeftButton), "realloc()",
"Step 3: Verifying if: The list of suggestions is opened. It is "
"possible to select one of the suggestions.")
# Step 4: Insert text "voi" to new line and press Tab.
......@@ -88,17 +91,23 @@ def main():
# Step 6: Insert text "ret" and press Ctrl+Space.
editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
type(editorWidget, "ret")
type(editorWidget, "retu")
waitForObjectItem(":popupFrame_Proposal_QListView", "return")
proposal = "return"
if useClang:
# clang adds a whitespace because the function needs to return a value
proposal += " "
waitForObjectItem(":popupFrame_Proposal_QListView", proposal)
except:"Could not find proposal popup.")
type(editorWidget, "<Right>")
type(editorWidget, "<Backspace>"), "ret",, "retu",
"Step 6: Verifying if: Suggestion is displayed but text is not "
"completed automatically even there is only one suggestion.")
invokeMenuItem('File', 'Revert "main.cpp" to Saved')
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
# exit qt creator
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
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