From cb7b24be15b0319475eed04150f7b7624e6dd61d Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 2 Feb 2016 18:02:20 +0100 Subject: [PATCH 01/15] Squish: Try to stabilize tst_qml_js_console Change-Id: I9de2d7784954ebe658530505ba64e816a95d411c Reviewed-by: Christian Stenger --- tests/system/suite_debugger/tst_qml_js_console/test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/system/suite_debugger/tst_qml_js_console/test.py b/tests/system/suite_debugger/tst_qml_js_console/test.py index 8075ddd56a3..f8a001e8f08 100644 --- a/tests/system/suite_debugger/tst_qml_js_console/test.py +++ b/tests/system/suite_debugger/tst_qml_js_console/test.py @@ -76,6 +76,8 @@ def getQmlJSConsoleOutput(): result = [] consoleView = waitForObject(":DebugModeWidget_QmlJSTools::Internal::QmlConsoleView") model = consoleView.model() + # old input, output, new input > 2 + waitFor("model.rowCount() > 2", 2000) return dumpItems(model)[:-1] except: return [""] From fb181b0911bc7f4c1176cf34f6a6154d633182d1 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 5 Feb 2016 17:22:34 +0100 Subject: [PATCH 02/15] Update qbs submodule. To HEAD of 1.4 branch. Change-Id: I42a6d9dc47a2088a62451ea42a9cf1b0ee50e08d Reviewed-by: Oswald Buddenhagen Reviewed-by: Christian Kandeler --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 73386649711..2739d102923 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 7338664971101a76a54fda7196c411f0235186c0 +Subproject commit 2739d10292361c2f7e8e92dc925c8efbb27bb881 From eb96cb45ffdc1f460082ec22f1b37f071baf90ed Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 9 Feb 2016 13:21:41 +0100 Subject: [PATCH 03/15] Cdbext: Fix QString dumper. Change-Id: I437e01c4408c3a5052d0b78c1c75de545f541a7e Reviewed-by: Christian Stenger --- src/libs/qtcreatorcdbext/symbolgroupvalue.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp index b15ebc0d01e..e145344720f 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp @@ -653,14 +653,16 @@ const QtInfo &QtInfo::get(const SymbolGroupValueContext &ctx) std::string moduleName; std::string::size_type exclPos = std::string::npos; std::string::size_type libPos = std::string::npos; + std::string::size_type qtPos = std::string::npos; const StringList &modules = SymbolGroupValue::getAllModuleNames(ctx); for (StringListConstIt module = modules.begin(), total = modules.end(); module != total; ++module) { moduleName = *module; - if (moduleName.find("Qt") != std::string::npos) { + qtPos = moduleName.find("Qt"); + if (qtPos != std::string::npos) { libPos = moduleName.find("Core"); - if (libPos != std::string::npos) + if (libPos != std::string::npos && (libPos - qtPos) < 4) break; } } From e1b14565facfb6b8f8c28f0c4394421f17bdc231 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 10 Feb 2016 15:33:38 +0100 Subject: [PATCH 04/15] CppTools: Do not clear project state on session unload Affected functionality was, among others: * Getting the correct project part when opening a file * Fallback project part (merged defines/includes) not up to date * Fallback for "Switch Header/Source" not up to date In the early days sessions switching was probably implemented by "close all projects of session X, open all projects of session Y". That's not the case anymore today. Change-Id: I4c6a80e2eb219615d3ea6fcf07be7c05072c8832 Reviewed-by: Christian Stenger Reviewed-by: Tobias Hunger --- src/plugins/cpptools/cppmodelmanager.cpp | 14 +------------- src/plugins/cpptools/cppmodelmanager.h | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 7a94dbb5809..3dad9eea301 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -326,8 +326,6 @@ CppModelManager::CppModelManager(QObject *parent) this, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*))); connect(sessionManager, SIGNAL(aboutToLoadSession(QString)), this, SLOT(onAboutToLoadSession())); - connect(sessionManager, SIGNAL(aboutToUnloadSession(QString)), - this, SLOT(onAboutToUnloadSession())); connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, this, &CppModelManager::onCurrentEditorChanged); @@ -1061,17 +1059,6 @@ void CppModelManager::onAboutToLoadSession() GC(); } -void CppModelManager::onAboutToUnloadSession() -{ - Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX); - do { - QMutexLocker locker(&d->m_projectMutex); - d->m_projectToProjectsInfo.clear(); - recalculateProjectPartMappings(); - d->m_dirty = true; - } while (0); -} - void CppModelManager::renameIncludes(const QString &oldFileName, const QString &newFileName) { if (oldFileName.isEmpty() || newFileName.isEmpty()) @@ -1103,6 +1090,7 @@ void CppModelManager::renameIncludes(const QString &oldFileName, const QString & void CppModelManager::onCoreAboutToClose() { + Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX); d->m_enableGC = false; } diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 4c10343edac..fb02d45829a 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -197,7 +197,6 @@ private slots: // This should be executed in the GUI thread. friend class Tests::ModelManagerTestHelper; void onAboutToLoadSession(); - void onAboutToUnloadSession(); void renameIncludes(const QString &oldFileName, const QString &newFileName); void onProjectAdded(ProjectExplorer::Project *project); void onAboutToRemoveProject(ProjectExplorer::Project *project); From b7ee61d389bd32e3b8b1acf75d97aca056fde3b0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 12 Feb 2016 14:10:53 +0100 Subject: [PATCH 05/15] Update qbs submodule. To HEAD of 1.4 branch. Change-Id: Ia56b692563848cf27db89b30bfd3439840a4dc41 Reviewed-by: Joerg Bornemann --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 2739d102923..bfaaba0422b 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 2739d10292361c2f7e8e92dc925c8efbb27bb881 +Subproject commit bfaaba0422b9f3467c8f081b79026f6c2a970b28 From 6f7c4249ad087316f71566e10716c1f99d3fde56 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 8 Feb 2016 14:34:15 +0100 Subject: [PATCH 06/15] Squish: Stabilize tst_CSUP06 Change-Id: I52f4c858f178cb3018e57461e2350564fbf78024 Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP06/test.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index b36adb57fdb..28a55e32b0d 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -128,7 +128,10 @@ def checkSymbolCompletion(editor, isClangCodeModel): def testSymb(currentLine, *args): missing, expectedSug, expectedRes = args symbol = currentLine.lstrip("/").strip() - propShown = waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 2500) + timeout = 2500 + if isClangCodeModel and JIRA.isBugStillOpen(15639): + timeout = 5000 + propShown = waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", timeout) test.compare(not propShown, symbol in missing, "Proposal widget is (not) shown as expected (%s)" % symbol) found = [] @@ -149,8 +152,11 @@ def checkSymbolCompletion(editor, isClangCodeModel): else: exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1] + expectedSug.get(symbol, found)[0]) - if not (isClangCodeModel and platform.system() in ('Microsoft', 'Windows') - and JIRA.isBugStillOpen(15483)): + 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.") performAutoCompletionTest(editor, ".*Complete symbols.*", "//", From 901d74121a616cda6a2d97c4c2284ef8f346e0fc Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 8 Feb 2016 18:18:28 +0100 Subject: [PATCH 07/15] Squish: Use existing tools for finding executables Change-Id: Ic3e7f5db6d12e37f908df3290893768a5be4fa56 Reviewed-by: Christian Stenger --- tests/system/shared/utils.py | 37 ++++++++---------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 3f293ebf0df..475a2d63d5b 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -138,37 +138,16 @@ def textUnderCursor(window, fromPos, toPos): return returnValue def which(program): - def is_exe(fpath): - return os.path.exists(fpath) and os.access(fpath, os.X_OK) - - def callableFile(path): - if is_exe(path): - return path - if platform.system() in ('Windows', 'Microsoft'): - for suffix in suffixes.split(os.pathsep): - if is_exe(path + suffix): - return path + suffix - return None - + # Don't use spawn.find_executable because it can't find .bat or + # .cmd files and doesn't check whether a file is executable (!) if platform.system() in ('Windows', 'Microsoft'): - suffixes = os.getenv("PATHEXT") - if not suffixes: - test.fatal("Can't read environment variable PATHEXT. Please check your installation.") - suffixes = "" - - fpath, fname = os.path.split(program) - if fpath: - return callableFile(program) + command = "where" + else: + command = "which" + foundPath = getOutputFromCmdline(command + " " + program) + if foundPath: + return foundPath.splitlines()[0] else: - if platform.system() in ('Windows', 'Microsoft'): - cf = callableFile(os.getcwd() + os.sep + program) - if cf: - return cf - for path in os.environ["PATH"].split(os.pathsep): - exe_file = os.path.join(path, program) - cf = callableFile(exe_file) - if cf: - return cf return None # this function removes the user files of given pro file(s) From 692261564f2adf33b03ecb38ea6d061ae724e38f Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 11 Feb 2016 20:59:31 +0100 Subject: [PATCH 08/15] Squish: Include binary editor in tests Change-Id: I0b4fc4e0cb18dcbd569ebdba201bfb9e2596ba5b Reviewed-by: Christian Stenger --- tests/system/objects.map | 1 + tests/system/shared/editor_utils.py | 3 ++ .../suite_editors/shared/testdata/files.tsv | 1 + .../tst_delete_externally/test.py | 33 ++++++++++--------- .../suite_editors/tst_edit_externally/test.py | 7 ++-- .../suite_editors/tst_select_all/test.py | 1 + 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index 294d54ac578..afb317ead40 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -146,6 +146,7 @@ :Qt Creator.scrollArea_QScrollArea {type='ProjectExplorer::PanelsWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.splitter_QSplitter {name='splitter' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_BinEditor::BinEditorWidget {type='BinEditor::BinEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Bookmarks_TreeView {type='TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CloseButton {type='CloseButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton {occurrence='4' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 2a442d42149..1239611c3f5 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -266,6 +266,7 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False): proEditorSuffixes = ["pro", "pri", "prf"] glslEditorSuffixes= ["frag", "vert", "fsh", "vsh", "glsl", "shader", "gsh"] pytEditorSuffixes = ["py", "pyw", "wsgi"] + binEditorSuffixes = ["bin"] suffix = __getFileSuffix__(curFile) expected = os.path.basename(curFile) if treeViewSyntax: @@ -281,6 +282,8 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False): editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") elif suffix in proEditorSuffixes or suffix in glslEditorSuffixes or suffix in pytEditorSuffixes: editor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget") + elif suffix in binEditorSuffixes: + editor = waitForObject(":Qt Creator_BinEditor::BinEditorWidget") else: test.log("Trying TextEditorWidget (file suffix: %s)" % suffix) try: diff --git a/tests/system/suite_editors/shared/testdata/files.tsv b/tests/system/suite_editors/shared/testdata/files.tsv index 8be0cd420b8..1563394a6d2 100644 --- a/tests/system/suite_editors/shared/testdata/files.tsv +++ b/tests/system/suite_editors/shared/testdata/files.tsv @@ -7,3 +7,4 @@ "creator/src/plugins/coreplugin/basefilewizard.cpp" "creator/src/plugins/coreplugin/basefilewizard.h" "creator/tests/system/suite_debugger/tst_simple_debug/test.py" +"creator/tests/system/suite_editors/shared/testdata/binary.bin" diff --git a/tests/system/suite_editors/tst_delete_externally/test.py b/tests/system/suite_editors/tst_delete_externally/test.py index fb17f6dc790..03a66c360cb 100644 --- a/tests/system/suite_editors/tst_delete_externally/test.py +++ b/tests/system/suite_editors/tst_delete_externally/test.py @@ -48,22 +48,25 @@ def main(): continue contentBefore = readFile(currentFile) - popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?" os.remove(currentFile) - test.compare(waitForObject(":File has been removed_QMessageBox").text, - popupText % currentFile) - clickButton(waitForObject(":File has been removed.Save_QPushButton")) - waitFor("os.path.exists(currentFile)", 5000) - # avoids a lock-up on some Linux machines, purely empiric, might have different cause - waitFor("checkIfObjectExists(':File has been removed_QMessageBox', False, 0)", 5000) + if not currentFile.endswith(".bin"): + popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?" + test.compare(waitForObject(":File has been removed_QMessageBox").text, + popupText % currentFile) + clickButton(waitForObject(":File has been removed.Save_QPushButton")) + waitFor("os.path.exists(currentFile)", 5000) + # avoids a lock-up on some Linux machines, purely empiric, might have different cause + waitFor("checkIfObjectExists(':File has been removed_QMessageBox', False, 0)", 5000) - test.compare(readFile(currentFile), contentBefore, - "Verifying that file '%s' was restored correctly" % currentFile) + test.compare(readFile(currentFile), contentBefore, + "Verifying that file '%s' was restored correctly" % currentFile) - # Different warning because of QTCREATORBUG-8130 - popupText2 = "The file %s has been removed outside Qt Creator. Do you want to save it under a different name, or close the editor?" - os.remove(currentFile) - test.compare(waitForObject(":File has been removed_QMessageBox").text, - popupText2 % currentFile) - clickButton(waitForObject(":File has been removed.Close_QPushButton")) + # Different warning because of QTCREATORBUG-8130 + popupText2 = "The file %s has been removed outside Qt Creator. Do you want to save it under a different name, or close the editor?" + os.remove(currentFile) + test.compare(waitForObject(":File has been removed_QMessageBox").text, + popupText2 % currentFile) + clickButton(waitForObject(":File has been removed.Close_QPushButton")) + test.verify(checkIfObjectExists(objectMap.realName(editor), False), + "Was the editor closed after deleting the file?") invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_editors/tst_edit_externally/test.py b/tests/system/suite_editors/tst_edit_externally/test.py index 503cec645e8..db42df04273 100644 --- a/tests/system/suite_editors/tst_edit_externally/test.py +++ b/tests/system/suite_editors/tst_edit_externally/test.py @@ -101,7 +101,8 @@ def main(): test.fatal("Failed to get editor - continuing...") continue # verify currentFile - waitFor("'addedLine' in str(editor.plainText)", 2500) - test.compare(editor.plainText, contentBefore + "addedLine\n", - "Verifying: file '%s' was reloaded modified." % currentFile) + if not currentFile.endswith(".bin"): + waitFor("'addedLine' in str(editor.plainText)", 2500) + test.compare(editor.plainText, contentBefore + "addedLine\n", + "Verifying: file '%s' was reloaded modified." % currentFile) invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py index 490c6f82a61..20a0829f329 100644 --- a/tests/system/suite_editors/tst_select_all/test.py +++ b/tests/system/suite_editors/tst_select_all/test.py @@ -35,6 +35,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) for currentFile in files: if not neededFilePresent(currentFile): return From 0d079062d9d0b532619d4e0a6ed238a484dd030a Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 15 Feb 2016 18:06:24 +0100 Subject: [PATCH 09/15] proparser: Make compile Change-Id: Ifb96fd11f542f9622ea3867c3bf877e722120136 Reviewed-by: Oswald Buddenhagen --- tests/manual/proparser/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/manual/proparser/main.cpp b/tests/manual/proparser/main.cpp index b7b31f92ada..64954edb910 100644 --- a/tests/manual/proparser/main.cpp +++ b/tests/manual/proparser/main.cpp @@ -61,7 +61,7 @@ public: virtual void message(int type, const QString &msg, const QString &fileName, int lineNo) { print(fileName, lineNo, type, msg); } - virtual void fileMessage(const QString &msg) + virtual void fileMessage(int, const QString &msg) { qWarning("%s", qPrintable(msg)); } virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {} From 9d8e4aa922daac8446d470e196ed5d297ae5e3c5 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 11 Feb 2016 14:13:30 +0100 Subject: [PATCH 10/15] Squish: Test overwriting of files when adding class Change-Id: I86ed9a3749f692fe9ead13c31e0ba62c2baa3020 Reviewed-by: Christian Stenger --- tests/system/shared/project.py | 9 ++++-- .../suite_general/tst_new_class/test.py | 31 ++++++++++++++++++- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index f77df6bc596..03a65974634 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -799,10 +799,15 @@ def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False, addTo test.compare(str(waitForObject("{name='HdrFileName' type='QLineEdit' visible='1'}").text), expectedHeaderName) clickButton(waitForObject(":Next_QPushButton")) - fileExistedBefore = os.path.exists(os.path.join(basePath, name)) + fileExistedBefore = False + if template == "C++ Class": + fileExistedBefore = (os.path.exists(os.path.join(basePath, name.lower() + ".cpp")) + or os.path.exists(os.path.join(basePath, name.lower() + ".h"))) + else: + fileExistedBefore = os.path.exists(os.path.join(basePath, name)) __createProjectHandleLastPage__(expectedFiles, addToVersionControl=addToVCS) if (fileExistedBefore): - overwriteDialog = "{type='Core::Internal::PromptOverwriteDialog' unnamed='1' visible='1'}" + overwriteDialog = "{type='Core::PromptOverwriteDialog' unnamed='1' visible='1'}" waitForObject(overwriteDialog) if forceOverwrite: buttonToClick = 'OK' diff --git a/tests/system/suite_general/tst_new_class/test.py b/tests/system/suite_general/tst_new_class/test.py index 7fc1a2e4665..9fb3502c9e4 100644 --- a/tests/system/suite_general/tst_new_class/test.py +++ b/tests/system/suite_general/tst_new_class/test.py @@ -34,10 +34,12 @@ def main(): newClassName = "MyNewClass" headerFileName = newClassName.lower() + ".h" sourceFileName = newClassName.lower() + ".cpp" + basePath = tempDir() + notOverwrittenComment = "// If you can read this, the file was not overwritten." startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - addCPlusPlusFileToCurrentProject(newClassName, "C++ Class", newBasePath=tempDir(), + addCPlusPlusFileToCurrentProject(newClassName, "C++ Class", newBasePath=basePath, expectedSourceName=sourceFileName, expectedHeaderName=headerFileName) @@ -51,6 +53,9 @@ def main(): "Header included in source file?") test.verify(newClassName + "::" + newClassName + "()" in editorText, "Ctor implementation in source file?") + type(editor, notOverwrittenComment) + type(editor, "") + invokeMenuItem("File", "Save All") clickButton(waitForObject(":Qt Creator.CloseDoc_QToolButton")) if test.verify(waitFor("headerFileName in str(mainWindow.windowTitle)", 1000), "Header file was shown after closing source?"): @@ -69,5 +74,29 @@ def main(): "No signals in non-Qt header file?") test.verify("slots" not in editorText, # QTCREATORBUG-14949 "No slots in non-Qt header file?") + type(editor, notOverwrittenComment) + type(editor, "") + invokeMenuItem("File", "Save All") + invokeMenuItem("File", "Close All") + + def overwritten(filename): + return notOverwrittenComment not in readFile(os.path.join(basePath, filename)) + + addCPlusPlusFileToCurrentProject(newClassName, "C++ Class", False, newBasePath=basePath, + expectedSourceName=sourceFileName, + expectedHeaderName=headerFileName) + test.verify(not waitFor("overwritten(sourceFileName)", 500), + "Source file should not be overwritten.") + test.verify(not waitFor("overwritten(headerFileName)", 500), + "Header file should not be overwritten.") + + addCPlusPlusFileToCurrentProject(newClassName, "C++ Class", True, newBasePath=basePath, + expectedSourceName=sourceFileName, + expectedHeaderName=headerFileName) + test.verify(waitFor("overwritten(sourceFileName)", 500), + "Source file should be overwritten.") + test.verify(waitFor("overwritten(headerFileName)", 500), + "Header file should be overwritten.") + invokeMenuItem("File", "Exit") return From 7aa8dc38e99698857a37307b518fc3b4b18252db Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 16 Feb 2016 13:44:07 +0100 Subject: [PATCH 11/15] Squish: override startApplication in startCreatorTryingClang() Change-Id: I6cb16c2a93ca46503f056c558eb8a6a2b33153d7 Reviewed-by: Christian Stenger --- tests/system/shared/clang.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/system/shared/clang.py b/tests/system/shared/clang.py index 4ed6e961df7..8f5604702b9 100644 --- a/tests/system/shared/clang.py +++ b/tests/system/shared/clang.py @@ -42,6 +42,7 @@ def startCreatorTryingClang(): except: # ClangCodeModel plugin has not been built - start without it test.warning("ClangCodeModel plugin not available - performing test without.") + overrideStartApplication() startApplication("qtcreator" + SettingsPath) return False From 998c2a73804aa24c38c1c21bab38a95407459a73 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 17 Feb 2016 12:21:41 +0100 Subject: [PATCH 12/15] SessionManager: Fix possible crashes in session manager Change-Id: Icd97c765fb4d5b88ff2986b927433e2583817605 Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 8e9bcbc1bb0..c0ddad60e01 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -332,7 +332,7 @@ void SessionManager::setActiveBuildConfiguration(Target *target, BuildConfigurat if (otherProject == target->project()) continue; Target *otherTarget = otherProject->activeTarget(); - if (otherTarget->kit()->id() != kitId) + if (!otherTarget || otherTarget->kit()->id() != kitId) continue; foreach (BuildConfiguration *otherBc, otherTarget->buildConfigurations()) { @@ -360,7 +360,7 @@ void SessionManager::setActiveDeployConfiguration(Target *target, DeployConfigur if (otherProject == target->project()) continue; Target *otherTarget = otherProject->activeTarget(); - if (otherTarget->kit()->id() != kitId) + if (!otherTarget || otherTarget->kit()->id() != kitId) continue; foreach (DeployConfiguration *otherDc, otherTarget->deployConfigurations()) { From eba6912e17320cfb8e9b2f963932ad8d968191b3 Mon Sep 17 00:00:00 2001 From: Michal Policht Date: Sat, 16 Jan 2016 17:20:56 +0100 Subject: [PATCH 13/15] Fix qtcreator_process_stub "cannot obtain a handle to the inferior" issue. Don't close the process/thread handles, so that the kernel doesn't free the resources before ConsoleProcess is able to obtain handles to them - this would be a problem if the child process exits very quickly. Also remove the superfluous free(env) for consistency. Task-number: QTCREATORBUG-13042 Change-Id: Ie25eeab71cd9dfd69831c37e4f02477446486309 Reviewed-by: Orgad Shaneh Reviewed-by: Oswald Buddenhagen --- src/libs/utils/process_stub_win.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/process_stub_win.c b/src/libs/utils/process_stub_win.c index 9162bf0b1ce..0e3a1cce67f 100644 --- a/src/libs/utils/process_stub_win.c +++ b/src/libs/utils/process_stub_win.c @@ -219,9 +219,11 @@ int main() if (WaitForSingleObject(pi.hProcess, INFINITE) == WAIT_FAILED) systemError("Wait for debugee failed, error %d\n"); - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - free(env); + + /* Don't close the process/thread handles, so that the kernel doesn't free + the resources before ConsoleProcess is able to obtain handles to them + - this would be a problem if the child process exits very quickly. */ doExit(0); + return 0; } From 4284a8fec784d9b63e56a5a36a01252ba85d0b7c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 22 Feb 2016 11:31:23 +0100 Subject: [PATCH 14/15] Update qbs submodule. To HEAD of 1.4 branch. Change-Id: I78d92360ebd6bbf347584e30468ade40f2ce4843 Reviewed-by: Jake Petroules --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index bfaaba0422b..a7b5a89919d 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit bfaaba0422b9f3467c8f081b79026f6c2a970b28 +Subproject commit a7b5a89919dc972dd38187fce78757cea1de0182 From 80d93ab52a749216360f0082b9aa9e741a340a99 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 17 Feb 2016 10:04:34 +0100 Subject: [PATCH 15/15] Fix qtcreator.sh for the new Qt deployment necessary with Qt 5.6 We need to deploy Qt 5.6 into its own directory (lib/Qt/) in the Qt Creator packages, so the LD_LIBRARY_PATH that is set in qtcreator.sh needs that too. Task-number: QTCREATORBUG-15748 Change-Id: I637322dfe5eb669b6447aa2f2b52e3ba2fe2979f Reviewed-by: Edward Welbourne Reviewed-by: Oswald Buddenhagen --- bin/qtcreator.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/qtcreator.sh b/bin/qtcreator.sh index aca30f5b9ec..454224c26ee 100755 --- a/bin/qtcreator.sh +++ b/bin/qtcreator.sh @@ -1,5 +1,9 @@ #! /bin/sh +# Use this script if you add paths to LD_LIBRARY_PATH +# that contain libraries that conflict with the +# libraries that Qt Creator depends on. + makeAbsolute() { case $1 in /*) @@ -30,6 +34,12 @@ fi bindir=`dirname "$me"` libdir=`cd "$bindir/../lib" ; pwd` -LD_LIBRARY_PATH=$libdir:$libdir/qtcreator${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} +# Add path to deployed Qt libraries in package +qtlibdir=$libdir/Qt/lib +if test -d "$qtlibdir"; then + qtlibpath=:$qtlibdir +fi +# Add Qt Creator library path +LD_LIBRARY_PATH=$libdir:$libdir/qtcreator$qtlibpath${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH exec "$bindir/qtcreator" ${1+"$@"}