forked from qt-creator/qt-creator
SquishTests: Fix CSUP test
Function completions nowadays provide the special tooltip holding the variations of argument lists if it is an overloaded function. Check for it and if it is present just close it to avoid an endless loop. (When processing the file we use 'Cursor Down' to navigate through the file but if the tooltip is open we just toggle between the overloads and process the same line again and again) Change-Id: I21742c5a460cf1537151e30c3135bebb83695703 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -87,7 +87,7 @@ def checkSymbolCompletion(editor, isClangCodeModel):
|
||||
"internal.o":"internal.one", "freefunc2":"freefunc2(",
|
||||
"using namespace st":"using namespace std", "afun":"afunc()"}
|
||||
if isClangCodeModel:
|
||||
missing = ["dummy.bla("]
|
||||
missing = ["dummy.bla(", "freefunc2("]
|
||||
expectedSuggestion["internal.o"] = ["one"]
|
||||
if platform.system() in ('Microsoft', 'Windows'):
|
||||
expectedSuggestion["using namespace st"] = ["std", "stdext"]
|
||||
@@ -118,6 +118,16 @@ def checkSymbolCompletion(editor, isClangCodeModel):
|
||||
suggestionToClick = " " + suggestionToClick
|
||||
doubleClickItem(':popupFrame_Proposal_QListView', suggestionToClick,
|
||||
5, 5, 0, Qt.LeftButton)
|
||||
|
||||
try:
|
||||
multiSuggestionToolTip = findObject(
|
||||
"{leftWidget={text~='[0-9]+ of [0-9]+' type='QLabel'} type='QToolButton'}")
|
||||
if multiSuggestionToolTip is not None:
|
||||
test.log("Closing tooltip containing overloaded function completion.")
|
||||
type(editor, "<Esc>")
|
||||
except LookupError: # no proposal or tool tip for unambiguous stuff - direct completion
|
||||
pass
|
||||
|
||||
changedLine = str(lineUnderCursor(editor)).strip()
|
||||
if symbol in expectedRes:
|
||||
exp = expectedRes[symbol]
|
||||
|
Reference in New Issue
Block a user