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:
Christian Stenger
2023-10-05 09:43:35 +02:00
parent 718de1bf78
commit 1d449ad7d6

View File

@@ -87,7 +87,7 @@ def checkSymbolCompletion(editor, isClangCodeModel):
"internal.o":"internal.one", "freefunc2":"freefunc2(", "internal.o":"internal.one", "freefunc2":"freefunc2(",
"using namespace st":"using namespace std", "afun":"afunc()"} "using namespace st":"using namespace std", "afun":"afunc()"}
if isClangCodeModel: if isClangCodeModel:
missing = ["dummy.bla("] missing = ["dummy.bla(", "freefunc2("]
expectedSuggestion["internal.o"] = ["one"] expectedSuggestion["internal.o"] = ["one"]
if platform.system() in ('Microsoft', 'Windows'): if platform.system() in ('Microsoft', 'Windows'):
expectedSuggestion["using namespace st"] = ["std", "stdext"] expectedSuggestion["using namespace st"] = ["std", "stdext"]
@@ -118,6 +118,16 @@ def checkSymbolCompletion(editor, isClangCodeModel):
suggestionToClick = " " + suggestionToClick suggestionToClick = " " + suggestionToClick
doubleClickItem(':popupFrame_Proposal_QListView', suggestionToClick, doubleClickItem(':popupFrame_Proposal_QListView', suggestionToClick,
5, 5, 0, Qt.LeftButton) 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() changedLine = str(lineUnderCursor(editor)).strip()
if symbol in expectedRes: if symbol in expectedRes:
exp = expectedRes[symbol] exp = expectedRes[symbol]