summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2020-02-20 12:06:28 +0100
committerRobert Loehning <robert.loehning@qt.io>2020-03-12 12:04:20 +0000
commit810538c281388c7205f212e7d6a3f0a98e564ab3 (patch)
treebabf8ebc6268ffd6c5ea3be6e6199c091518c905 /tests
parent757e55d50becf60fa8c10c92a541728a0665911a (diff)
downloadqt-creator-810538c281388c7205f212e7d6a3f0a98e564ab3.tar.gz
Squish: Adjust expectations in suite_CSUP
Task-number: QTCREATORBUG-22728 Task-number: QTCREATORBUG-22729 Task-number: QTCREATORBUG-23159 Change-Id: Iad21fa8e82f314bc7bde42dc184cf72553eab3a7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/system/suite_CSUP/tst_CSUP01/test.py4
-rw-r--r--tests/system/suite_CSUP/tst_CSUP02/test.py7
-rw-r--r--tests/system/suite_CSUP/tst_CSUP06/test.py25
3 files changed, 16 insertions, 20 deletions
diff --git a/tests/system/suite_CSUP/tst_CSUP01/test.py b/tests/system/suite_CSUP/tst_CSUP01/test.py
index 63779811f6..39f959b212 100644
--- a/tests/system/suite_CSUP/tst_CSUP01/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP01/test.py
@@ -81,7 +81,9 @@ def main():
try:
proposalListView = waitForObject(":popupFrame_Proposal_QListView")
waitForObjectItem(proposalListView, "unsigned")
- test.compare(proposalListView.model().rowCount(), 1, 'Only one proposal for "unsi"?')
+ if useClang and platform.system() == 'Linux': # QTCREATORBUG-23159
+ test.compare(proposalListView.model().rowCount(), 1,
+ 'Only one proposal for "unsi"?')
type(proposalListView, "<Tab>")
test.compare(str(lineUnderCursor(editorWidget)).strip(), "unsigned",
"Step 4: Verifying if: Word 'unsigned' is completed because only one option is available.")
diff --git a/tests/system/suite_CSUP/tst_CSUP02/test.py b/tests/system/suite_CSUP/tst_CSUP02/test.py
index 0c0e833156..f5e7894d62 100644
--- a/tests/system/suite_CSUP/tst_CSUP02/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP02/test.py
@@ -65,9 +65,10 @@ def main():
usedProposal = "class derived from QObject"
expectedProposals = ["class", "class ", "class template",
usedProposal, "class derived from QWidget"]
- test.compare(len(shownProposals), len(expectedProposals), "Number of proposed templates")
- test.compare(set(shownProposals), set(expectedProposals),
- "Expected proposals shown, ignoring order?")
+ test.xcompare(len(shownProposals), len(expectedProposals), # QTCREATORBUG-23159
+ "Number of proposed templates")
+ test.verify(set(expectedProposals).issubset(set(shownProposals)),
+ "Expected proposals shown, ignoring order?")
doubleClickItem(listView, usedProposal, 5, 5, 0, Qt.LeftButton)
pattern = ("(?<=class)\s+name\s*:\s*public\s+QObject\s*\{\s*Q_OBJECT\s+"
"public:\s+name\(\)\s*\{\}\s+virtual\s+~name\(\)\s*\{\}\s+\};")
diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py
index c28c8bb198..3ac5208842 100644
--- a/tests/system/suite_CSUP/tst_CSUP06/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP06/test.py
@@ -64,22 +64,15 @@ def performAutoCompletionTest(editor, lineToStartRegEx, linePrefix, testFunc, *f
def checkIncludeCompletion(editor, isClangCodeModel):
test.log("Check auto-completion of include statements.")
# define special handlings
- noProposal = ["vec", "detail/hea", "dum"]
+ noProposal = ["detail/hea"]
specialHandling = {"ios":"iostream", "cstd":"cstdio"}
- if platform.system() in ('Microsoft', 'Windows'):
- missing = ["lin"]
- elif platform.system() == "Darwin":
- missing = ["lin", "Win"]
- noProposal.remove("vec")
- else:
- missing = ["Win"]
# define test function to perform the _real_ auto completion test on the current line
def testIncl(currentLine, *args):
- missing, noProposal, specialHandling = args
+ noProposal, specialHandling = args
inclSnippet = currentLine.split("//#include")[-1].strip().strip('<"')
propShown = waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 2500)
- test.compare(not propShown, inclSnippet in missing or inclSnippet in noProposal,
+ test.compare(not propShown, inclSnippet in noProposal,
"Proposal widget is (not) shown as expected (%s)" % inclSnippet)
if propShown:
proposalListView = waitForObject(':popupFrame_Proposal_QListView')
@@ -89,14 +82,11 @@ def checkIncludeCompletion(editor, isClangCodeModel):
else:
type(proposalListView, "<Return>")
changedLine = str(lineUnderCursor(editor)).strip()
- if inclSnippet in missing:
- test.compare(changedLine, currentLine.lstrip("/"), "Include has not been modified.")
- else:
- test.verify(changedLine[-1] in '>"/',
- "'%s' has been completed to '%s'" % (currentLine.lstrip("/"), changedLine))
+ test.verify(changedLine[-1] in '>"/',
+ "'%s' has been completed to '%s'" % (currentLine.lstrip("/"), changedLine))
performAutoCompletionTest(editor, ".*Complete includes.*", "//#include",
- testIncl, missing, noProposal, specialHandling)
+ testIncl, noProposal, specialHandling)
def checkSymbolCompletion(editor, isClangCodeModel):
test.log("Check auto-completion of symbols.")
@@ -114,13 +104,16 @@ def checkSymbolCompletion(editor, isClangCodeModel):
"internal.o":"internal.one", "freefunc2":"freefunc2(",
"using namespace st":"using namespace std", "afun":"afunc()"}
if isClangCodeModel:
+ missing.remove("Dummy::s") # QTCREATORBUG-22729
missing.remove("internal.o")
+ expectedSuggestion["in"] = ["internal", "int"] # QTCREATORBUG-22728
expectedSuggestion["internal.o"] = ["one", "operator="]
if platform.system() in ('Microsoft', 'Windows'):
expectedSuggestion["using namespace st"] = ["std", "stdext"]
else:
expectedSuggestion["using namespace st"] = ["std", "struct ", "struct template"]
else:
+ missing.remove("afun")
expectedSuggestion["using namespace st"] = ["std", "st"]
# define test function to perform the _real_ auto completion test on the current line
def testSymb(currentLine, *args):