diff options
author | Eike Ziller <eike.ziller@qt.io> | 2023-05-05 10:39:47 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2023-05-05 10:39:47 +0200 |
commit | 7724f8653f9c0e5625179ecda8a545cb30f4e1b4 (patch) | |
tree | cbe5b15de32a6df7012bafb6f4e853ab9c21c676 /tests | |
parent | 15193d3250834f85d90b790c0c40632e6de65033 (diff) | |
parent | b083a4d55efbf9f6558034c0ce4efe31062e0e5b (diff) | |
download | qt-creator-7724f8653f9c0e5625179ecda8a545cb30f4e1b4.tar.gz |
Merge remote-tracking branch 'origin/10.0'
Change-Id: I7a3925ad8e4f97461b64a70217102ed900430253
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/persistenttrie/persistenttrie.qbs | 1 | ||||
-rw-r--r-- | tests/system/shared/project.py | 1 | ||||
-rw-r--r-- | tests/system/shared/utils.py | 9 | ||||
-rw-r--r-- | tests/system/suite_CSUP/tst_CSUP03/test.py | 4 | ||||
-rw-r--r-- | tests/system/suite_CSUP/tst_CSUP06/test.py | 41 | ||||
-rw-r--r-- | tests/system/suite_HELP/tst_HELP04/test.py | 3 | ||||
-rw-r--r-- | tests/system/suite_QMLS/tst_QMLS04/test.py | 14 | ||||
-rw-r--r-- | tests/system/suite_editors/tst_clean_whitespaces/test.py | 2 | ||||
-rw-r--r-- | tests/system/suite_editors/tst_select_all/test.py | 2 |
9 files changed, 41 insertions, 36 deletions
diff --git a/tests/auto/qml/persistenttrie/persistenttrie.qbs b/tests/auto/qml/persistenttrie/persistenttrie.qbs index 9f03227ee7..0d6490a5b6 100644 --- a/tests/auto/qml/persistenttrie/persistenttrie.qbs +++ b/tests/auto/qml/persistenttrie/persistenttrie.qbs @@ -5,7 +5,6 @@ QtcAutotest { Depends { name: "QmlJS" } files: [ "tst_testtrie.h", "tst_testtrie.cpp" ] cpp.defines: base.concat([ - 'QMLJS_LIBRARY', 'QTCREATORDIR="' + project.ide_source_tree + '"', 'TESTSRCDIR="' + path + '"' ]) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 06c7e115e3..babbf0eb6e 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -544,6 +544,7 @@ def checkAndCopyFiles(dataSet, fieldName, templateDir): files = map(lambda record: os.path.normpath(os.path.join(srcPath, testData.field(record, fieldName))), dataSet) + files = list(files) # copy data from map object to list to make it reusable for currentFile in files: if not neededFilePresent(currentFile): return [] diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 7397fad5ed..96e63f29f0 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -513,8 +513,13 @@ def progressBarWait(timeout=60000, warn=True): checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", False, timeout) def readFile(filename): - with open(filename, "r") as f: - return f.read() + try: + with open(filename, "r") as f: + return f.read() + except: + # Read file as binary + with open(filename, "rb") as f: + return f.read() def simpleFileName(navigatorFileName): # try to find the last part of the given name, assume it's inside a (folder) structure diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index 8667f3c2ac..4e6f3e2099 100644 --- a/tests/system/suite_CSUP/tst_CSUP03/test.py +++ b/tests/system/suite_CSUP/tst_CSUP03/test.py @@ -50,10 +50,6 @@ def main(): } for useClang in [False, True]: with TestSection(getCodeModelString(useClang)): - if (useClang and platform.system() in ('Windows', 'Microsoft') - and JIRA.isBugStillOpen(18607)): - test.warning("Skipping unstable tests on Windows", "See QTCREATORBUG-18607") - continue if not startCreatorVerifyingClang(useClang): continue projectName = createNewNonQtProject(tempDir(), "project-csup03", diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 56e934db40..7682d1a672 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -42,8 +42,14 @@ def performAutoCompletionTest(editor, lineToStartRegEx, linePrefix, testFunc, *f def checkIncludeCompletion(editor, isClangCodeModel): test.log("Check auto-completion of include statements.") # define special handlings - noProposal = ["detail/hea"] + noProposal = [] specialHandling = {"ios":"iostream", "cstd":"cstdio"} + if isClangCodeModel: + specialHandling["QDe"] = "QDebug" + for i in specialHandling.keys(): + specialHandling[i] = " %s>" % specialHandling[i] + else: + noProposal += ["detail/hea"] # define test function to perform the _real_ auto completion test on the current line def testIncl(currentLine, *args): @@ -69,25 +75,24 @@ def checkIncludeCompletion(editor, isClangCodeModel): def checkSymbolCompletion(editor, isClangCodeModel): test.log("Check auto-completion of symbols.") # define special handlings - expectedSuggestion = {"in":["internal", "int", "INT_MAX", "INT_MIN"], + expectedSuggestion = {"in":["internal", "int", "intmax_t"], "Dum":["Dummy", "dummy"], "Dummy::O":["ONE","one"], - "dummy.":["foo", "bla", "ONE", "one", "PI", "sfunc", "v1", "v2", "v3"], + "dummy.":["one", "ONE", "PI", "v1", "v2", "v3"], "dummy.o":["one", "ONE"], "Dummy::In":["Internal", "INT"], "Dummy::Internal::":["DOUBLE", "one"] } missing = ["Dummy::s", "Dummy::P", "dummy.b", "dummy.bla(", "internal.o", "freefunc2"] - expectedResults = {"dummy.":"dummy.foo(", "Dummy::s":"Dummy::sfunc()", + expectedResults = {"Dummy::s":"Dummy::sfunc()", "Dummy::P":"Dummy::PI", "dummy.b":"dummy.bla(", "dummy.bla(":"dummy.bla(", "internal.o":"internal.one", "freefunc2":"freefunc2(", "using namespace st":"using namespace std", "afun":"afunc()"} if isClangCodeModel: - missing.remove("internal.o") - expectedSuggestion["in"] = ["internal", "int"] # QTCREATORBUG-22728 - expectedSuggestion["internal.o"] = ["one", "operator="] + missing = ["dummy.bla("] + expectedSuggestion["internal.o"] = ["one"] if platform.system() in ('Microsoft', 'Windows'): expectedSuggestion["using namespace st"] = ["std", "stdext"] else: - expectedSuggestion["using namespace st"] = ["std", "struct ", "struct template"] + expectedSuggestion["using namespace st"] = ["std", "struct", "struct template"] else: expectedSuggestion["using namespace st"] = ["std", "st"] # define test function to perform the _real_ auto completion test on the current line @@ -101,27 +106,25 @@ def checkSymbolCompletion(editor, isClangCodeModel): found = [] if propShown: proposalListView = waitForObject(':popupFrame_Proposal_QListView') - found = dumpItems(proposalListView.model()) + found = [i.strip() for i in dumpItems(proposalListView.model())] diffShownExp = set(expectedSug.get(symbol, [])) - set(found) if not test.verify(len(diffShownExp) == 0, "Verify if all expected suggestions could be found"): test.log("Expected but not found suggestions: %s" % diffShownExp, "%s | %s" % (expectedSug[symbol], str(found))) # select first item of the expected suggestion list - doubleClickItem(':popupFrame_Proposal_QListView', expectedSug.get(symbol, found)[0], + suggestionToClick = expectedSug.get(symbol, found)[0] + if isClangCodeModel: + suggestionToClick = " " + suggestionToClick + doubleClickItem(':popupFrame_Proposal_QListView', suggestionToClick, 5, 5, 0, Qt.LeftButton) changedLine = str(lineUnderCursor(editor)).strip() if symbol in expectedRes: exp = expectedRes[symbol] else: exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1] - + expectedSug.get(symbol, found)[0]) - if isClangCodeModel and changedLine != exp and JIRA.isBugStillOpen(15483): - test.xcompare(changedLine, exp, "Verify completion matches (QTCREATORBUG-15483).") - test.verify(changedLine.startswith(exp.replace("(", "").replace(")", "")), - "Verify completion starts with expected string.") - else: - test.compare(changedLine, exp, "Verify completion matches.") + + expectedSug.get(symbol, found)[0]).strip() + test.compare(changedLine, exp, "Verify completion matches.") performAutoCompletionTest(editor, ".*Complete symbols.*", "//", testSymb, missing, expectedSuggestion, expectedResults) @@ -143,6 +146,10 @@ def main(): return editor = getEditorForFileSuffix("main.cpp") if editor: + if useClang: + test.log("Wait for parsing to finish...") + progressBarWait(15000) + test.log("Parsing done.") checkIncludeCompletion(editor, useClang) checkSymbolCompletion(editor, useClang) invokeMenuItem('File', 'Revert "main.cpp" to Saved') diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index e4c0500d23..3fd63309ad 100644 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -87,8 +87,7 @@ def main(): type(resultWidget, "<Return>") waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000) verifySelection(searchKeyword) - if not (searchKeyword == "QODBC" and JIRA.isBugStillOpen(10331)): - verifyUrl(urlDictionary[searchKeyword]) + verifyUrl(urlDictionary[searchKeyword]) else: test.verify(waitFor("noMatch in " "str(resultWidget.plainText)", 1000), diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 351b59ac63..2c96939151 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -48,14 +48,12 @@ def main(): pass # open MyComponent.qml file for verification docOpened = openDocument(myCompTE) - if JIRA.isBugStillOpen(28985): - test.xverify(docOpened, "Was MyComponent.qml properly generated in project explorer?") - saveAndExit() - return - if not test.verify(docOpened, "Was MyComponent.qml properly generated in project explorer?"): - test.fatal("Could not open MyComponent.qml.") - saveAndExit() - return + # Work around QTCREATORBUG-28985 + test.xverify(docOpened, "Was MyComponent.qml properly generated in project explorer?") + saveAndExit() + return + # The workaround will be removed in master branch + # Following dead code left in intentionally to still allow merging forward changes in it. editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") codeText = str(editorArea.plainText) # there should be Text item in new file diff --git a/tests/system/suite_editors/tst_clean_whitespaces/test.py b/tests/system/suite_editors/tst_clean_whitespaces/test.py index cdf2add27c..6dab4720f9 100644 --- a/tests/system/suite_editors/tst_clean_whitespaces/test.py +++ b/tests/system/suite_editors/tst_clean_whitespaces/test.py @@ -12,7 +12,7 @@ TripleTab = '\t\t\t' def main(): files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), testData.dataset("files.tsv")) - files = filter(lambda x: not x.endswith(".bin"), files) + files = list(filter(lambda x: not x.endswith(".bin"), files)) for currentFile in files: if not neededFilePresent(currentFile): return diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py index be96e8f482..bf95250cf7 100644 --- a/tests/system/suite_editors/tst_select_all/test.py +++ b/tests/system/suite_editors/tst_select_all/test.py @@ -8,7 +8,7 @@ source("../../shared/qtcreator.py") def main(): files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), testData.dataset("files.tsv")) - files = filter(lambda x: not x.endswith(".bin"), files) + files = list(filter(lambda x: not x.endswith(".bin"), files)) for currentFile in files: if not neededFilePresent(currentFile): return |