Merge remote-tracking branch 'origin/3.6'

Conflicts:
	src/shared/qbs
	tests/manual/proparser/main.cpp

Change-Id: I13654bf10c14eb6b1d6805fe86b67ac73b2e4d75
This commit is contained in:
Eike Ziller
2016-02-24 10:08:37 +01:00
18 changed files with 108 additions and 75 deletions

View File

@@ -1,5 +1,9 @@
#! /bin/sh #! /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() { makeAbsolute() {
case $1 in case $1 in
/*) /*)
@@ -30,6 +34,12 @@ fi
bindir=`dirname "$me"` bindir=`dirname "$me"`
libdir=`cd "$bindir/../lib" ; pwd` 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 export LD_LIBRARY_PATH
exec "$bindir/qtcreator" ${1+"$@"} exec "$bindir/qtcreator" ${1+"$@"}

View File

@@ -648,14 +648,16 @@ const QtInfo &QtInfo::get(const SymbolGroupValueContext &ctx)
std::string moduleName; std::string moduleName;
std::string::size_type exclPos = std::string::npos; std::string::size_type exclPos = std::string::npos;
std::string::size_type libPos = 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); const StringList &modules = SymbolGroupValue::getAllModuleNames(ctx);
for (StringListConstIt module = modules.begin(), total = modules.end(); for (StringListConstIt module = modules.begin(), total = modules.end();
module != total; ++module) { module != total; ++module) {
moduleName = *module; moduleName = *module;
if (moduleName.find("Qt") != std::string::npos) { qtPos = moduleName.find("Qt");
if (qtPos != std::string::npos) {
libPos = moduleName.find("Core"); libPos = moduleName.find("Core");
if (libPos != std::string::npos) if (libPos != std::string::npos && (libPos - qtPos) < 4)
break; break;
} }
} }

View File

@@ -214,9 +214,11 @@ int main()
if (WaitForSingleObject(pi.hProcess, INFINITE) == WAIT_FAILED) if (WaitForSingleObject(pi.hProcess, INFINITE) == WAIT_FAILED)
systemError("Wait for debugee failed, error %d\n"); systemError("Wait for debugee failed, error %d\n");
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread); /* Don't close the process/thread handles, so that the kernel doesn't free
free(env); 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); doExit(0);
return 0; return 0;
} }

View File

@@ -326,8 +326,6 @@ CppModelManager::CppModelManager(QObject *parent)
this, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*))); this, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*)));
connect(sessionManager, SIGNAL(aboutToLoadSession(QString)), connect(sessionManager, SIGNAL(aboutToLoadSession(QString)),
this, SLOT(onAboutToLoadSession())); this, SLOT(onAboutToLoadSession()));
connect(sessionManager, SIGNAL(aboutToUnloadSession(QString)),
this, SLOT(onAboutToUnloadSession()));
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
this, &CppModelManager::onCurrentEditorChanged); this, &CppModelManager::onCurrentEditorChanged);
@@ -1021,17 +1019,6 @@ void CppModelManager::onAboutToLoadSession()
GC(); 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) void CppModelManager::renameIncludes(const QString &oldFileName, const QString &newFileName)
{ {
if (oldFileName.isEmpty() || newFileName.isEmpty()) if (oldFileName.isEmpty() || newFileName.isEmpty())
@@ -1063,6 +1050,7 @@ void CppModelManager::renameIncludes(const QString &oldFileName, const QString &
void CppModelManager::onCoreAboutToClose() void CppModelManager::onCoreAboutToClose()
{ {
Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX);
d->m_enableGC = false; d->m_enableGC = false;
} }

View File

@@ -195,7 +195,6 @@ private slots:
// This should be executed in the GUI thread. // This should be executed in the GUI thread.
friend class Tests::ModelManagerTestHelper; friend class Tests::ModelManagerTestHelper;
void onAboutToLoadSession(); void onAboutToLoadSession();
void onAboutToUnloadSession();
void renameIncludes(const QString &oldFileName, const QString &newFileName); void renameIncludes(const QString &oldFileName, const QString &newFileName);
void onProjectAdded(ProjectExplorer::Project *project); void onProjectAdded(ProjectExplorer::Project *project);
void onAboutToRemoveProject(ProjectExplorer::Project *project); void onAboutToRemoveProject(ProjectExplorer::Project *project);

View File

@@ -327,7 +327,7 @@ void SessionManager::setActiveBuildConfiguration(Target *target, BuildConfigurat
if (otherProject == target->project()) if (otherProject == target->project())
continue; continue;
Target *otherTarget = otherProject->activeTarget(); Target *otherTarget = otherProject->activeTarget();
if (otherTarget->kit()->id() != kitId) if (!otherTarget || otherTarget->kit()->id() != kitId)
continue; continue;
foreach (BuildConfiguration *otherBc, otherTarget->buildConfigurations()) { foreach (BuildConfiguration *otherBc, otherTarget->buildConfigurations()) {
@@ -355,7 +355,7 @@ void SessionManager::setActiveDeployConfiguration(Target *target, DeployConfigur
if (otherProject == target->project()) if (otherProject == target->project())
continue; continue;
Target *otherTarget = otherProject->activeTarget(); Target *otherTarget = otherProject->activeTarget();
if (otherTarget->kit()->id() != kitId) if (!otherTarget || otherTarget->kit()->id() != kitId)
continue; continue;
foreach (DeployConfiguration *otherDc, otherTarget->deployConfigurations()) { foreach (DeployConfiguration *otherDc, otherTarget->deployConfigurations()) {

View File

@@ -146,6 +146,7 @@
:Qt Creator.scrollArea_QScrollArea {type='ProjectExplorer::PanelsWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :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.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_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_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_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'} :Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton {occurrence='4' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}

View File

@@ -37,6 +37,7 @@ def startCreatorTryingClang():
except: except:
# ClangCodeModel plugin has not been built - start without it # ClangCodeModel plugin has not been built - start without it
test.warning("ClangCodeModel plugin not available - performing test without.") test.warning("ClangCodeModel plugin not available - performing test without.")
overrideStartApplication()
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
return False return False

View File

@@ -261,6 +261,7 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False):
proEditorSuffixes = ["pro", "pri", "prf"] proEditorSuffixes = ["pro", "pri", "prf"]
glslEditorSuffixes= ["frag", "vert", "fsh", "vsh", "glsl", "shader", "gsh"] glslEditorSuffixes= ["frag", "vert", "fsh", "vsh", "glsl", "shader", "gsh"]
pytEditorSuffixes = ["py", "pyw", "wsgi"] pytEditorSuffixes = ["py", "pyw", "wsgi"]
binEditorSuffixes = ["bin"]
suffix = __getFileSuffix__(curFile) suffix = __getFileSuffix__(curFile)
expected = os.path.basename(curFile) expected = os.path.basename(curFile)
if treeViewSyntax: if treeViewSyntax:
@@ -276,6 +277,8 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False):
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
elif suffix in proEditorSuffixes or suffix in glslEditorSuffixes or suffix in pytEditorSuffixes: elif suffix in proEditorSuffixes or suffix in glslEditorSuffixes or suffix in pytEditorSuffixes:
editor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget") editor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget")
elif suffix in binEditorSuffixes:
editor = waitForObject(":Qt Creator_BinEditor::BinEditorWidget")
else: else:
test.log("Trying TextEditorWidget (file suffix: %s)" % suffix) test.log("Trying TextEditorWidget (file suffix: %s)" % suffix)
try: try:

View File

@@ -794,10 +794,15 @@ def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False, addTo
test.compare(str(waitForObject("{name='HdrFileName' type='QLineEdit' visible='1'}").text), test.compare(str(waitForObject("{name='HdrFileName' type='QLineEdit' visible='1'}").text),
expectedHeaderName) expectedHeaderName)
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
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)) fileExistedBefore = os.path.exists(os.path.join(basePath, name))
__createProjectHandleLastPage__(expectedFiles, addToVersionControl=addToVCS) __createProjectHandleLastPage__(expectedFiles, addToVersionControl=addToVCS)
if (fileExistedBefore): if (fileExistedBefore):
overwriteDialog = "{type='Core::Internal::PromptOverwriteDialog' unnamed='1' visible='1'}" overwriteDialog = "{type='Core::PromptOverwriteDialog' unnamed='1' visible='1'}"
waitForObject(overwriteDialog) waitForObject(overwriteDialog)
if forceOverwrite: if forceOverwrite:
buttonToClick = 'OK' buttonToClick = 'OK'

View File

@@ -133,37 +133,16 @@ def textUnderCursor(window, fromPos, toPos):
return returnValue return returnValue
def which(program): def which(program):
def is_exe(fpath): # Don't use spawn.find_executable because it can't find .bat or
return os.path.exists(fpath) and os.access(fpath, os.X_OK) # .cmd files and doesn't check whether a file is executable (!)
def callableFile(path):
if is_exe(path):
return path
if platform.system() in ('Windows', 'Microsoft'): if platform.system() in ('Windows', 'Microsoft'):
for suffix in suffixes.split(os.pathsep): command = "where"
if is_exe(path + suffix): else:
return path + suffix command = "which"
return None foundPath = getOutputFromCmdline(command + " " + program)
if foundPath:
if platform.system() in ('Windows', 'Microsoft'): return foundPath.splitlines()[0]
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)
else: 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 return None
# this function removes the user files of given pro file(s) # this function removes the user files of given pro file(s)

View File

@@ -123,7 +123,10 @@ def checkSymbolCompletion(editor, isClangCodeModel):
def testSymb(currentLine, *args): def testSymb(currentLine, *args):
missing, expectedSug, expectedRes = args missing, expectedSug, expectedRes = args
symbol = currentLine.lstrip("/").strip() 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, test.compare(not propShown, symbol in missing,
"Proposal widget is (not) shown as expected (%s)" % symbol) "Proposal widget is (not) shown as expected (%s)" % symbol)
found = [] found = []
@@ -144,8 +147,11 @@ def checkSymbolCompletion(editor, isClangCodeModel):
else: else:
exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1] exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1]
+ expectedSug.get(symbol, found)[0]) + expectedSug.get(symbol, found)[0])
if not (isClangCodeModel and platform.system() in ('Microsoft', 'Windows') if isClangCodeModel and changedLine != exp and JIRA.isBugStillOpen(15483):
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.") test.compare(changedLine, exp, "Verify completion matches.")
performAutoCompletionTest(editor, ".*Complete symbols.*", "//", performAutoCompletionTest(editor, ".*Complete symbols.*", "//",

View File

@@ -71,6 +71,8 @@ def getQmlJSConsoleOutput():
result = [] result = []
consoleView = waitForObject(":DebugModeWidget_Debugger::Internal::ConsoleView") consoleView = waitForObject(":DebugModeWidget_Debugger::Internal::ConsoleView")
model = consoleView.model() model = consoleView.model()
# old input, output, new input > 2
waitFor("model.rowCount() > 2", 2000)
return dumpItems(model)[:-1] return dumpItems(model)[:-1]
except: except:
return [""] return [""]

View File

@@ -7,3 +7,4 @@
"creator/src/plugins/coreplugin/basefilewizard.cpp" "creator/src/plugins/coreplugin/basefilewizard.cpp"
"creator/src/plugins/coreplugin/basefilewizard.h" "creator/src/plugins/coreplugin/basefilewizard.h"
"creator/tests/system/suite_debugger/tst_simple_debug/test.py" "creator/tests/system/suite_debugger/tst_simple_debug/test.py"
"creator/tests/system/suite_editors/shared/testdata/binary.bin"
1 filename
7 creator/src/plugins/coreplugin/basefilewizard.cpp
8 creator/src/plugins/coreplugin/basefilewizard.h
9 creator/tests/system/suite_debugger/tst_simple_debug/test.py
10 creator/tests/system/suite_editors/shared/testdata/binary.bin

View File

@@ -43,8 +43,9 @@ def main():
continue continue
contentBefore = readFile(currentFile) 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) os.remove(currentFile)
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, test.compare(waitForObject(":File has been removed_QMessageBox").text,
popupText % currentFile) popupText % currentFile)
clickButton(waitForObject(":File has been removed.Save_QPushButton")) clickButton(waitForObject(":File has been removed.Save_QPushButton"))
@@ -61,4 +62,6 @@ def main():
test.compare(waitForObject(":File has been removed_QMessageBox").text, test.compare(waitForObject(":File has been removed_QMessageBox").text,
popupText2 % currentFile) popupText2 % currentFile)
clickButton(waitForObject(":File has been removed.Close_QPushButton")) 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") invokeMenuItem("File", "Exit")

View File

@@ -96,6 +96,7 @@ def main():
test.fatal("Failed to get editor - continuing...") test.fatal("Failed to get editor - continuing...")
continue continue
# verify currentFile # verify currentFile
if not currentFile.endswith(".bin"):
waitFor("'addedLine' in str(editor.plainText)", 2500) waitFor("'addedLine' in str(editor.plainText)", 2500)
test.compare(editor.plainText, contentBefore + "addedLine\n", test.compare(editor.plainText, contentBefore + "addedLine\n",
"Verifying: file '%s' was reloaded modified." % currentFile) "Verifying: file '%s' was reloaded modified." % currentFile)

View File

@@ -30,6 +30,7 @@ source("../../shared/qtcreator.py")
def main(): def main():
files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")),
testData.dataset("files.tsv")) testData.dataset("files.tsv"))
files = filter(lambda x: not x.endswith(".bin"), files)
for currentFile in files: for currentFile in files:
if not neededFilePresent(currentFile): if not neededFilePresent(currentFile):
return return

View File

@@ -29,10 +29,12 @@ def main():
newClassName = "MyNewClass" newClassName = "MyNewClass"
headerFileName = newClassName.lower() + ".h" headerFileName = newClassName.lower() + ".h"
sourceFileName = newClassName.lower() + ".cpp" sourceFileName = newClassName.lower() + ".cpp"
basePath = tempDir()
notOverwrittenComment = "// If you can read this, the file was not overwritten."
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
addCPlusPlusFileToCurrentProject(newClassName, "C++ Class", newBasePath=tempDir(), addCPlusPlusFileToCurrentProject(newClassName, "C++ Class", newBasePath=basePath,
expectedSourceName=sourceFileName, expectedSourceName=sourceFileName,
expectedHeaderName=headerFileName) expectedHeaderName=headerFileName)
@@ -46,6 +48,9 @@ def main():
"Header included in source file?") "Header included in source file?")
test.verify(newClassName + "::" + newClassName + "()" in editorText, test.verify(newClassName + "::" + newClassName + "()" in editorText,
"Ctor implementation in source file?") "Ctor implementation in source file?")
type(editor, notOverwrittenComment)
type(editor, "<Return>")
invokeMenuItem("File", "Save All")
clickButton(waitForObject(":Qt Creator.CloseDoc_QToolButton")) clickButton(waitForObject(":Qt Creator.CloseDoc_QToolButton"))
if test.verify(waitFor("headerFileName in str(mainWindow.windowTitle)", 1000), if test.verify(waitFor("headerFileName in str(mainWindow.windowTitle)", 1000),
"Header file was shown after closing source?"): "Header file was shown after closing source?"):
@@ -64,5 +69,29 @@ def main():
"No signals in non-Qt header file?") "No signals in non-Qt header file?")
test.verify("slots" not in editorText, # QTCREATORBUG-14949 test.verify("slots" not in editorText, # QTCREATORBUG-14949
"No slots in non-Qt header file?") "No slots in non-Qt header file?")
type(editor, notOverwrittenComment)
type(editor, "<Return>")
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") invokeMenuItem("File", "Exit")
return return