From 8e18adc70f4ea49eb1e20976220d79874228257d Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 20 Mar 2013 13:48:20 +0100 Subject: C++: Fix crash in code completion. Caused by a dangling pointer of a template instantiation which had been cloned into the wrong control. The fix is to remove that control and refer to the control of the bindings (which is the correct one). Change-Id: I951a60f2e613aae1e4ac901ce99c820212018709 Reviewed-by: Nikolai Kosjar Reviewed-by: Erik Verbruggen --- tests/auto/cplusplus/cxx11/tst_cxx11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp index 51a9f05aeb..2c78b9bd32 100644 --- a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp +++ b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp @@ -174,7 +174,7 @@ void tst_cxx11::inlineNamespaceLookup() snapshot.insert(doc); LookupContext context(doc, snapshot); - QSharedPointer control = context.control(); + QSharedPointer control = context.bindings()->control(); QList results = context.lookup(control->identifier("foo"), doc->globalNamespace()); QCOMPARE(results.size(), 1); // the symbol is visible from the global scope -- cgit v1.2.1 From cc765472d25c9727309e8ebc0a4b1b2448b0cdaa Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 2 May 2013 16:38:42 +0200 Subject: Squish: Use readFile() if possible Change-Id: Ia850e624f24dd57589d7276af22aef1498c3c799 Reviewed-by: Robert Loehning --- tests/system/suite_HELP/tst_HELP02/test.py | 4 +--- tests/system/suite_editors/tst_select_all/test.py | 9 +-------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/system/suite_HELP/tst_HELP02/test.py b/tests/system/suite_HELP/tst_HELP02/test.py index 4133724fb8..b6b19ee6f8 100755 --- a/tests/system/suite_HELP/tst_HELP02/test.py +++ b/tests/system/suite_HELP/tst_HELP02/test.py @@ -16,9 +16,7 @@ def getQtCreatorVersionFromDialog(): def getQtCreatorVersionFromFile(): qtCreatorPriFileName = "../../../../qtcreator.pri" # open file and read version - file = open(qtCreatorPriFileName, "r") - fileText = file.read() - file.close() + fileText = readFile(qtCreatorPriFileName) chk = re.search("(?<=QTCREATOR_VERSION =)\s\d+.\d+.\d+", fileText) try: ver = chk.group(0).strip() diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py index 81f051a59a..21ee3a7dc3 100644 --- a/tests/system/suite_editors/tst_select_all/test.py +++ b/tests/system/suite_editors/tst_select_all/test.py @@ -2,13 +2,6 @@ source("../../shared/qtcreator.py") # This tests for QTCREATORBUG-5757 -# Results can differ from actual size on disk (different line endings on Windows) -def charactersInFile(filename): - f = open(filename,"r") - content = f.read() - f.close() - return len(content) - def main(): files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), testData.dataset("files.tsv")) @@ -21,7 +14,7 @@ def main(): return for currentFile in files: test.log("Opening file %s" % currentFile) - size = charactersInFile(currentFile) + size = len(readFile(currentFile)) invokeMenuItem("File", "Open File or Project...") selectFromFileDialog(currentFile, True) editor = getEditorForFileSuffix(currentFile) -- cgit v1.2.1 From e0b7cd6b03b5ac09c889b798d02e8e8b853a74da Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 3 May 2013 09:31:14 +0200 Subject: Squish: Added timeout for waitFor() Change-Id: I9d15d03c9b289f41830a57ed659264a324338cc6 Reviewed-by: Robert Loehning --- tests/system/suite_CSUP/tst_CSUP04/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index 05c7d5e4a6..327b7e977b 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -35,7 +35,7 @@ def main(): invokeMenuItem("File", "Exit") return # wait until search finished and verify search results - waitFor("searchFinished") + waitFor("searchFinished", 20000) validateSearchResult(18) 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. " @@ -49,7 +49,7 @@ def main(): searchFinished = False type(editorWidget, "") # wait until search finished and verify search results - waitFor("searchFinished") + waitFor("searchFinished", 20000) validateSearchResult(3) # exit qt creator invokeMenuItem("File", "Save All") -- cgit v1.2.1 From edf8b4a59b79a3fef254542c92e4befabf3ced3e Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 3 May 2013 10:31:00 +0200 Subject: Squish: Stabilize invoking context menu items on Mac Change-Id: I64ed356b6120c38d51c646ae409bbbc3a4fe9e8e Reviewed-by: Robert Loehning --- tests/system/shared/editor_utils.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index ac698353dd..a48a523847 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -47,6 +47,8 @@ def menuVisibleAtEditor(editor, menuInList): menuInList[0] = None try: menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500) + if platform.system() == 'Darwin': + menu.activateWindow() success = menu.visible and widgetContainsPoint(editor, menu.mapToGlobal(QPoint(0, 0))) if success: menuInList[0] = menu -- cgit v1.2.1 From 4255ec2df604be9ca40cec979c5f61f75ae20ce3 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 7 May 2013 16:06:16 +0200 Subject: Squish: Corrected verifyBuildAndRun() ...to deal with the behavior described in QTCREATORBUG-9212 Change-Id: Ic69098be5a09fe6aa85c40218483c2d679584ab3 Reviewed-by: Christian Stenger --- tests/system/suite_APTW/shared/aptw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/system/suite_APTW/shared/aptw.py b/tests/system/suite_APTW/shared/aptw.py index 447401fe42..44d42cab66 100755 --- a/tests/system/suite_APTW/shared/aptw.py +++ b/tests/system/suite_APTW/shared/aptw.py @@ -9,7 +9,7 @@ def verifyBuildAndRun(): # check application output log appOutput = logApplicationOutput() if appOutput: - test.verify(re.search(".*([Pp]rogram).*(unexpectedly).*([Ff]inished).*", str(appOutput)) and + test.verify(re.search(".* exited with code \d+", str(appOutput)) and re.search('[Ss]tarting.*', str(appOutput)), "Verifying if built app started and closed successfully.") -- cgit v1.2.1 From 8ca5b55a0bafd744cf62c20de379a7738cb76138 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 7 May 2013 11:08:40 +0200 Subject: Squish: Prepare re-usage of batch editing... ...of the environment variables for the next run. Change-Id: Iaf383dfa361971c75be0e180d72ab95c5df83ebe Reviewed-by: Robert Loehning --- tests/system/objects.map | 2 ++ tests/system/shared/hook_utils.py | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/system/objects.map b/tests/system/objects.map index b39ba183f6..abc6939063 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -137,6 +137,8 @@ :Restart required_QMessageBox {text='The language change will take effect after a restart of Qt Creator.' type='QMessageBox' unnamed='1' visible='1'} :Revert to Saved.Proceed_QPushButton {text='Proceed' type='QPushButton' unnamed='1' visible='1' window=':Revert to Saved_QMessageBox'} :Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'} +:RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) Build Environment' type='QLabel' unnamed='1' visible='1'} :Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'} :Symbol Server_Utils::CheckableMessageBox {type='Utils::CheckableMessageBox' unnamed='1' visible='1' windowTitle='Symbol Server'} :User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'} diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py index fca63726a1..1683a1dc3e 100644 --- a/tests/system/shared/hook_utils.py +++ b/tests/system/shared/hook_utils.py @@ -17,9 +17,7 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port): switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN) result = __configureCustomExecutable__(projectName, port, mkspec, qtVersion) if result: - clickButton(waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' text='Details' " - "type='Utils::DetailsButton' unnamed='1' visible='1' " - "leftWidget={type='QLabel' text~='Us(e|ing) Build Environment' unnamed='1' visible='1'}}")) + ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton") envVarsTableView = waitForObject("{type='QTableView' visible='1' unnamed='1'}") model = envVarsTableView.model() changingVars = [] @@ -41,17 +39,23 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port): changingVars.append("SQUISH_LIBQTDIR=%s" % replacement) else: changingVars.append(varName) - #test.log("Unsetting %s for run" % varName) - clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}")) - editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' " - "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}") - typeLines(editor, changingVars) - clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' " - "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")) + batchEditRunEnvironment(kitCount, 0, changingVars, True) switchViewTo(ViewConstants.EDIT) return result +def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRunSettings=False): + if not alreadyOnRunSettings: + switchViewTo(ViewConstants.PROJECTS) + switchToBuildOrRunSettingsFor(kitCount, currentTarget, ProjectSettings.RUN) + ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton") + clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}")) + editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' " + "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}") + typeLines(editor, modifications) + clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' " + "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")) + def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port): switchViewTo(ViewConstants.PROJECTS) switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN, True) -- cgit v1.2.1