aboutsummaryrefslogtreecommitdiffstats
path: root/tests/system/suite_CSUP/tst_CSUP01
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2016-02-01 16:15:48 +0100
committerEike Ziller <eike.ziller@theqtcompany.com>2016-02-01 16:15:48 +0100
commit5952165cf9d2a8d9294ee7b652d1bdcb2066fc9f (patch)
tree807647fb7464d61910f87c706e61e3aeaa6ae036 /tests/system/suite_CSUP/tst_CSUP01
parentbb3b7307ef0bc1f70b3db823829a0569f49c2cda (diff)
parentf38d29133956c4196fbfd66895f3a31fad5f9948 (diff)
Merge remote-tracking branch 'origin/3.6'
Diffstat (limited to 'tests/system/suite_CSUP/tst_CSUP01')
-rw-r--r--tests/system/suite_CSUP/tst_CSUP01/test.py89
1 files changed, 49 insertions, 40 deletions
diff --git a/tests/system/suite_CSUP/tst_CSUP01/test.py b/tests/system/suite_CSUP/tst_CSUP01/test.py
index 1c710b6e89..a75292833f 100644
--- a/tests/system/suite_CSUP/tst_CSUP01/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP01/test.py
@@ -43,57 +43,66 @@ def triggerCompletion(editorWidget):
# entry of test
def main():
- startApplication("qtcreator" + SettingsPath)
+ clangLoaded = startCreatorTryingClang()
if not startedWithoutPluginError():
return
# create qt quick application
# Step 1: Open test .pro project.
createNewQtQuickApplication(tempDir(), "SampleApp")
+ for useClang in set([False, clangLoaded]):
+ selectClangCodeModel(clangLoaded, useClang)
+ changeAutocompleteToManual(False)
# Step 2: Open .cpp file in Edit mode.
- if not openDocument("SampleApp.Sources.main\\.cpp"):
- test.fatal("Could not open main.cpp")
- invokeMenuItem("File", "Exit")
- return
- test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
- "Step 2: Verifying if: .cpp file is opened in Edit mode.")
+ if not openDocument("SampleApp.Sources.main\\.cpp"):
+ test.fatal("Could not open main.cpp")
+ invokeMenuItem("File", "Exit")
+ return
+ test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
+ "Step 2: Verifying if: .cpp file is opened in Edit mode.")
# Step 3: Insert text "re" to new line in Editor mode and press Ctrl+Space.
- editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
- if not placeCursorToLine(editorWidget, "QGuiApplication app(argc, argv);"):
- earlyExit("Did not find first line in function block.")
- return
- type(editorWidget, "<Return>")
- type(editorWidget, "re")
- triggerCompletion(editorWidget)
- waitForObjectItem(":popupFrame_Proposal_QListView", "register")
- doubleClickItem(":popupFrame_Proposal_QListView", "register", 5, 5, 0, Qt.LeftButton)
- test.compare(str(lineUnderCursor(editorWidget)).strip(), "register",
- "Step 3: Verifying if: The list of suggestions is opened. It is "
- "possible to select one of the suggestions.")
+ editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
+ if not placeCursorToLine(editorWidget, "QGuiApplication app(argc, argv);"):
+ earlyExit("Did not find first line in function block.")
+ return
+ type(editorWidget, "<Return>")
+ type(editorWidget, "re")
+ triggerCompletion(editorWidget)
+ waitForObjectItem(":popupFrame_Proposal_QListView", "realloc")
+ doubleClickItem(":popupFrame_Proposal_QListView", "realloc", 5, 5, 0, Qt.LeftButton)
+ test.compare(str(lineUnderCursor(editorWidget)).strip(), "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.
- resetLine(editorWidget)
- type(editorWidget, "voi")
- waitForObjectItem(":popupFrame_Proposal_QListView", "void")
- type(waitForObject(":popupFrame_Proposal_QListView"), "<Tab>")
- test.compare(str(lineUnderCursor(editorWidget)).strip(), "void",
- "Step 4: Verifying if: Word 'void' is completed because only one option is available.")
+ resetLine(editorWidget)
+ type(editorWidget, "voi")
+ waitForObjectItem(":popupFrame_Proposal_QListView", "void")
+ type(waitForObject(":popupFrame_Proposal_QListView"), "<Tab>")
+ test.compare(str(lineUnderCursor(editorWidget)).strip(), "void",
+ "Step 4: Verifying if: Word 'void' is completed because only one option is available.")
# Step 5: From "Tools -> Options -> Text Editor -> Completion" select Activate completion Manually,
# uncheck Autocomplete common prefix and press Apply and then Ok . Return to Edit mode.
- test.log("Step 5: Change Code Completion settings")
- changeAutocompleteToManual()
+ test.log("Step 5: Change Code Completion settings")
+ changeAutocompleteToManual()
# Step 6: Insert text "ret" and press Ctrl+Space.
- editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
- resetLine(editorWidget)
- type(editorWidget, "ret")
- triggerCompletion(editorWidget)
- try:
- waitForObjectItem(":popupFrame_Proposal_QListView", "return")
- except:
- test.fail("Could not find proposal popup.")
- type(editorWidget, "<Right>")
- type(editorWidget, "<Backspace>")
- test.compare(str(lineUnderCursor(editorWidget)).strip(), "ret",
- "Step 6: Verifying if: Suggestion is displayed but text is not "
- "completed automatically even there is only one suggestion.")
+ editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
+ resetLine(editorWidget)
+ type(editorWidget, "retu")
+ triggerCompletion(editorWidget)
+ try:
+ proposal = "return"
+ if useClang:
+ # clang adds a whitespace because the function needs to return a value
+ proposal += " "
+ waitForObjectItem(":popupFrame_Proposal_QListView", proposal)
+ except:
+ test.fail("Could not find proposal popup.")
+ type(editorWidget, "<Right>")
+ type(editorWidget, "<Backspace>")
+ test.compare(str(lineUnderCursor(editorWidget)).strip(), "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")