diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-01-25 13:21:11 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-01-25 13:21:18 +0100 |
commit | d18d7eaef68f6105dcb285e8a8aefde5407f8416 (patch) | |
tree | 210234a7372ef292e14e186f71ba857ea7e12228 /tests/system/suite_editors | |
parent | a081e8c96f11b8286a9e8810e438b1209727edcf (diff) | |
parent | 5b9350baf68e8319236960cc4e65b4f0f150fab6 (diff) |
Merge remote-tracking branch 'origin/3.6'
Change-Id: I4e1ec4054d7364057c63e63e293a246e64afdddb
Diffstat (limited to 'tests/system/suite_editors')
-rw-r--r-- | tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv | 20 | ||||
-rw-r--r-- | tests/system/suite_editors/tst_qml_editor/test.py | 39 |
2 files changed, 30 insertions, 29 deletions
diff --git a/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv b/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv index b562381147..98fdd1aebb 100644 --- a/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv +++ b/tests/system/suite_editors/tst_memberoperator/testdata/usages.tsv @@ -5,16 +5,16 @@ "" "QCoreApplication qa;" "qa" "." "qa." "" "QCoreApplication *p;" "p" "." "p->" "" "QCoreApplication &ref = a;" "ref" "." "ref." -"<QPointer>" "QPointer p;" "p" "." "p." -"<QPointer>" "QPointer *poi;" "poi" "." "poi->" -"<QPointer>" "QPointer &poi;" "poi" "." "poi." -"<QPointer>" "QPointer poi[5];" "poi[2]" "." "poi[2]." -"<QPointer>" "QPointer *poi[5];" "poi[2]" "." "poi[2]->" -"<memory>" "std::auto_ptr sap;" "sap" "." "sap." -"<memory>" "std::auto_ptr *sap;" "sap" "." "sap->" -"<memory>" "std::auto_ptr &sap;" "sap" "." "sap." -"<memory>" "std::auto_ptr sap[10];" "sap[2]" "." "sap[2]." -"<memory>" "std::auto_ptr *sap[10];" "sap[2]" "." "sap[2]->" +"<QPointer>" "QPointer<QCoreApplication> p;" "p" "." "p." +"<QPointer>" "QPointer<QCoreApplication> *poi;" "poi" "." "poi->" +"<QPointer>" "QPointer<QCoreApplication> &poi;" "poi" "." "poi." +"<QPointer>" "QPointer<QCoreApplication> poi[5];" "poi[2]" "." "poi[2]." +"<QPointer>" "QPointer<QCoreApplication> *poi[5];" "poi[2]" "." "poi[2]->" +"<memory>" "std::auto_ptr<QCoreApplication> sap;" "sap" "." "sap." +"<memory>" "std::auto_ptr<QCoreApplication> *sap;" "sap" "." "sap->" +"<memory>" "std::auto_ptr<QCoreApplication> &sap;" "sap" "." "sap." +"<memory>" "std::auto_ptr<QCoreApplication> sap[10];" "sap[2]" "." "sap[2]." +"<memory>" "std::auto_ptr<QCoreApplication> *sap[10];" "sap[2]" "." "sap[2]->" "<QVector>" "QVector<QCoreApplication> vec;" "vec" "." "vec." "<QVector>" "QVector<QCoreApplication *> vec;" "vec" "." "vec." "<QVector>" "QVector<QCoreApplication> *vec;" "vec" "." "vec->" diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index aea9862833..69dc71a14b 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -26,7 +26,7 @@ source("../../shared/qtcreator.py") def main(): - sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/keyinteraction/focus") + sourceExample = os.path.abspath(Qt5Path.getPaths(Qt5Path.EXAMPLES)[0] + "/declarative/keyinteraction/focus") proFile = "focus.pro" if not neededFilePresent(os.path.join(sourceExample, proFile)): return @@ -34,10 +34,10 @@ def main(): if not startedWithoutPluginError(): return # add docs to have the correct tool tips - addHelpDocumentation([os.path.join(sdkPath, "Documentation", "qt.qch")]) - templateDir = prepareTemplate(sourceExample) - openQmakeProject(os.path.join(templateDir, proFile), Targets.DESKTOP_480_DEFAULT) - openDocument("focus.QML.qml.focus\\.qml") + addHelpDocumentation([os.path.join(Qt5Path.getPaths(Qt5Path.DOCS)[0], "qtquick.qch")]) + templateDir = prepareTemplate(sourceExample, "/../../helper") + openQmakeProject(os.path.join(templateDir, proFile), Targets.DESKTOP_521_DEFAULT) + openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml") testRenameId() testFindUsages() testHovering() @@ -49,19 +49,20 @@ def testRenameId(): navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}") model = navTree.model() - files = ["Core.ContextMenu\\.qml", "Core.GridMenu\\.qml", "Core.ListMenu\\.qml", "focus\\.qml"] + files = ["FocusCore.ContextMenu\\.qml", "FocusCore.GridMenu\\.qml", + "FocusCore.ListMenu\\.qml", "focus\\.qml"] originalTexts = {} editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") formerTxt = editor.plainText for file in files: - openDocument("focus.QML.qml.%s" % file) + openDocument("focus.QML.qml" + os.sep + "focus.%s" % file) # wait until editor content switched to the double-clicked file while formerTxt==editor.plainText: editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") # store content for next round formerTxt = editor.plainText originalTexts.setdefault(file, "%s" % formerTxt) - test.log("stored %s's content" % file.replace("Core.","").replace("\\","")) + test.log("stored %s's content" % file.replace("FocusCore.","").replace("\\","")) # last opened file is the main file focus.qml line = "FocusScope\s*\{" if not placeCursorToLine(editor, line, True): @@ -78,18 +79,18 @@ def testRenameId(): # store editor content for synchronizing purpose formerTxt = editor.plainText for file in files: - openDocument("focus.QML.qml.%s" % file) + openDocument("focus.QML.qml" + os.sep + "focus.%s" % file) # wait until editor content switched to double-clicked file while formerTxt==editor.plainText: editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") # store content for next round formerTxt = editor.plainText originalText = originalTexts.get(file).replace("mainView", "renamedView") - test.compare(originalText,formerTxt, "Comparing %s" % file.replace("Core.","").replace("\\","")) + test.compare(originalText,formerTxt, "Comparing %s" % file.replace("FocusCore.","").replace("\\","")) invokeMenuItem("File","Save All") def __invokeFindUsage__(treeView, filename, line, additionalKeyPresses, expectedCount): - openDocument("focus.QML.qml.%s" % filename) + openDocument("focus.QML.qml" + os.sep + "focus.%s" % filename) editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") if not placeCursorToLine(editor, line, True): test.fatal("File seems to have changed... Canceling current test") @@ -116,7 +117,7 @@ def testHovering(): navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}") test.log("Testing hovering elements") - openDocument("focus.QML.qml.focus\\.qml") + openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml") editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") lines=["FocusScope\s*\{", "Rectangle\s*\{"] if platform.system() == "Darwin": @@ -126,15 +127,15 @@ def testHovering(): additionalKeyPresses = [home, "<Right>"] expectedTypes = ["TextTip", "TextTip"] expectedValues = [ - {'text':'<table><tr><td valign=middle>FocusScope\n<p>The FocusScope object explicitly ' - 'creates a focus scope.</p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}, - {'text':'<table><tr><td valign=middle>Rectangle\n<p>The Rectangle item provides a filled rectangle with an ' - 'optional border.</p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'} + {'text':'<table><tr><td valign=middle>FocusScope\n<p>Explicitly ' + 'creates a focus scope </p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}, + {'text':'<table><tr><td valign=middle>Rectangle\n<p>Paints a filled rectangle with an ' + 'optional border </p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'} ] alternativeValues = [{"text":"FocusScope"}, {"text":"Rectangle"}] verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues) test.log("Testing hovering properties") - openDocument("focus.QML.qml.focus\\.qml") + openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml") editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") lines = ['focus:\s*true', 'color:\s*"black"', 'states:\s*State\s*\{', 'transitions:\s*Transition\s*\{'] expectedTypes = ["TextTip", "TextTip", "TextTip", "TextTip"] @@ -154,7 +155,7 @@ def testHovering(): alternativeValues = [{"text":"boolean"}, {"text":"string"}, {"text":"State"}, {"text":"Transition"}] verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues) test.log("Testing hovering expressions") - openDocument("focus.QML.qml.focus\\.qml") + openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml") editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") lines=['color:\s*"black"', 'color:\s*"#3E606F"'] additionalKeyPresses = ["<Left>"] @@ -162,7 +163,7 @@ def testHovering(): alternativeValues = [None, "#39616B"] expectedTypes = ["ColorTip", "ColorTip"] verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues) - openDocument("focus.QML.qml.Core.ListMenu\\.qml") + openDocument("focus.QML.qml" + os.sep + "focus.FocusCore.ListMenu\\.qml") editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") lines=['Rectangle\s*\{.*color:\s*"#D1DBBD"', 'NumberAnimation\s*\{\s*.*Easing.OutQuint\s*\}'] additionalKeyPresses = ["<Left>", "<Left>", "<Left>", "<Left>"] |