From 6447eb9cbf73a7520889ded8ad36188a064f005e Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 25 Sep 2014 12:13:23 +0200 Subject: Squish: Run tst_CSUP04 with Clang code model, too Change-Id: I3a2f029e0f1c85ecbd3c161b097f4e975014f714 Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP04/test.py | 68 ++++++++++++++++-------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index dd8fa406d5..280bd65544 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -39,44 +39,48 @@ def main(): # copy example project to temp directory templateDir = prepareTemplate(sourceExample) examplePath = os.path.join(templateDir, proFile) - startApplication("qtcreator" + SettingsPath) + startCreatorTryingClang() if not startedWithoutPluginError(): return # open example project openQmakeProject(examplePath) # wait for parsing to complete progressBarWait(30000) - # open .cpp file in editor - if not openDocument("propertyanimation.Sources.main\\.cpp"): - test.fatal("Could not open main.cpp") - invokeMenuItem("File", "Exit") - return - test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), - "Verifying if: .cpp file is opened in Edit mode.") - # place cursor on line "QmlApplicationViewer viewer;" - editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") - # invoke find usages from context menu on word "viewer" - if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "", 10): - invokeMenuItem("File", "Exit") - return - # wait until search finished and verify search results - waitForSearchResults() - validateSearchResult(14) - result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) - test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " - "File with used text is opened.") - # move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U. - openDocument("propertyanimation.Sources.main\\.cpp") - if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"): - return - for i in range(4): - type(editorWidget, "") - type(editorWidget, "") - # wait until search finished and verify search results - waitForSearchResults() - validateSearchResult(3) - # exit qt creator - invokeMenuItem("File", "Save All") + models = iterateAvailableCodeModels() + for current in models: + if current != models[0]: + selectCodeModel(current) + test.log("Testing code model: %s" % current) + # open .cpp file in editor + if not openDocument("propertyanimation.Sources.main\\.cpp"): + test.fatal("Could not open main.cpp") + invokeMenuItem("File", "Exit") + return + test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), + "Verifying if: .cpp file is opened in Edit mode.") + # place cursor on line "QmlApplicationViewer viewer;" + editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") + # invoke find usages from context menu on word "viewer" + if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "", 10): + invokeMenuItem("File", "Exit") + return + # wait until search finished and verify search results + waitForSearchResults() + validateSearchResult(14) + result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) + test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " + "File with used text is opened.") + # move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U. + openDocument("propertyanimation.Sources.main\\.cpp") + if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"): + return + for i in range(4): + type(editorWidget, "") + type(editorWidget, "") + # wait until search finished and verify search results + waitForSearchResults() + validateSearchResult(3) + invokeMenuItem("File", "Close All") invokeMenuItem("File", "Exit") def waitForSearchResults(): -- cgit v1.2.1