forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8'
Conflicts: qtcreator.pri qtcreator.qbs Change-Id: I1310d473584f1e2cd44008d45747c868103bbde1
This commit is contained in:
@@ -1770,11 +1770,19 @@ QmlJS::ConsoleItem *constructLogItemTree(QmlJS::ConsoleItem *parent,
|
|||||||
|
|
||||||
ConsoleItem *item = new ConsoleItem(parent, ConsoleItem::UndefinedType, text);
|
ConsoleItem *item = new ConsoleItem(parent, ConsoleItem::UndefinedType, text);
|
||||||
|
|
||||||
|
QSet<QString> childrenFetched;
|
||||||
foreach (const QVariant &property, objectData.properties) {
|
foreach (const QVariant &property, objectData.properties) {
|
||||||
ConsoleItem *child = constructLogItemTree(item, extractData(property, refsVal),
|
const QmlV8ObjectData childObjectData = extractData(property, refsVal);
|
||||||
refsVal);
|
if (childObjectData.handle == objectData.handle)
|
||||||
if (child)
|
continue;
|
||||||
|
ConsoleItem *child = constructLogItemTree(item, childObjectData, refsVal);
|
||||||
|
if (child) {
|
||||||
|
const QString text = child->text();
|
||||||
|
if (childrenFetched.contains(text))
|
||||||
|
continue;
|
||||||
|
childrenFetched.insert(text);
|
||||||
item->insertChild(child, sorted);
|
item->insertChild(child, sorted);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ void BranchDialog::checkout()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!stashMessage.isEmpty() && branchCheckoutDialog.moveLocalChangesToNextBranch())
|
if (!stashMessage.isEmpty() && branchCheckoutDialog.moveLocalChangesToNextBranch())
|
||||||
gitClient->stashPop(m_repository);
|
gitClient->endStashScope(m_repository);
|
||||||
else if (branchCheckoutDialog.popStashOfNextBranch())
|
else if (branchCheckoutDialog.popStashOfNextBranch())
|
||||||
gitClient->synchronousStashRestore(m_repository, stashName, true);
|
gitClient->synchronousStashRestore(m_repository, stashName, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ void GnuMakeParser::stdError(const QString &line)
|
|||||||
m_suppressIssues = true;
|
m_suppressIssues = true;
|
||||||
QString description = m_makeLine.cap(8);
|
QString description = m_makeLine.cap(8);
|
||||||
Task::TaskType type = Task::Error;
|
Task::TaskType type = Task::Error;
|
||||||
if (description.startsWith(QLatin1String("warning: "))) {
|
if (description.startsWith(QLatin1String("warning: "), Qt::CaseInsensitive)) {
|
||||||
description = description.mid(9);
|
description = description.mid(9);
|
||||||
type = Task::Warning;
|
type = Task::Warning;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1162,7 +1162,7 @@ DiffChunk VcsBaseEditorWidget::diffChunk(QTextCursor cursor) const
|
|||||||
unicode.append(QLatin1Char('\n'));
|
unicode.append(QLatin1Char('\n'));
|
||||||
for (block = block.next() ; block.isValid() ; block = block.next()) {
|
for (block = block.next() ; block.isValid() ; block = block.next()) {
|
||||||
const QString line = block.text();
|
const QString line = block.text();
|
||||||
if (checkChunkLine(line, &chunkStart)) {
|
if (checkChunkLine(line, &chunkStart) || d->m_diffFilePattern.indexIn(line) == 0) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
unicode += line;
|
unicode += line;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
:DebugModeWidget.Breakpoints_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Break' type='QDockWidget' visible='1' windowTitle='Breakpoints'}
|
:DebugModeWidget.Breakpoints_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Break' type='QDockWidget' visible='1' windowTitle='Breakpoints'}
|
||||||
:DebugModeWidget.Debugger Log_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Output' type='QDockWidget' visible='1' windowTitle='Debugger Log'}
|
:DebugModeWidget.Debugger Log_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.Output' type='QDockWidget' visible='1' windowTitle='Debugger Log'}
|
||||||
:DebugModeWidget.Debugger Toolbar_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger Toolbar' type='QDockWidget' visible='1' windowTitle='Debugger Toolbar'}
|
:DebugModeWidget.Debugger Toolbar_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger Toolbar' type='QDockWidget' visible='1' windowTitle='Debugger Toolbar'}
|
||||||
|
:DebugModeWidget.Locals and Expressions_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.LocalsAndWatchers' type='QDockWidget' visible='1' windowTitle='Locals and Expressions'}
|
||||||
:DebugModeWidget.OK_QPushButton {container=':Qt Creator.DebugModeWidget_QSplitter' text='OK' type='QPushButton' unnamed='1' visible='1'}
|
:DebugModeWidget.OK_QPushButton {container=':Qt Creator.DebugModeWidget_QSplitter' text='OK' type='QPushButton' unnamed='1' visible='1'}
|
||||||
:DebugModeWidget_QComboBox {container=':Qt Creator.DebugModeWidget_QSplitter' occurrence='2' type='QComboBox' unnamed='1' visible='1'}
|
:DebugModeWidget_QComboBox {container=':Qt Creator.DebugModeWidget_QSplitter' occurrence='2' type='QComboBox' unnamed='1' visible='1'}
|
||||||
:Debugger Toolbar.Continue_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Continue' type='QToolButton' unnamed='1' visible='1'}
|
:Debugger Toolbar.Continue_QToolButton {container=':DebugModeWidget.Debugger Toolbar_QDockWidget' text='Continue' type='QToolButton' unnamed='1' visible='1'}
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
:JavaScript.QmlProfilerV8ProfileTable_QmlProfiler::Internal::QmlProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerV8ProfileTable' type='QmlProfiler::Internal::QmlProfilerEventsMainView' visible='1'}
|
:JavaScript.QmlProfilerV8ProfileTable_QmlProfiler::Internal::QmlProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerV8ProfileTable' type='QmlProfiler::Internal::QmlProfilerEventsMainView' visible='1'}
|
||||||
:Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
|
:Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
|
||||||
:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='4' type='QComboBox' unnamed='1' visible='1'}
|
:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='4' type='QComboBox' unnamed='1' visible='1'}
|
||||||
|
:Locals and Expressions_Debugger::Internal::WatchTreeView {container=':DebugModeWidget.Locals and Expressions_QDockWidget' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1' windowTitle='Locals and Expressions'}
|
||||||
:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
|
:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
|
||||||
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
|
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
|
||||||
:New_Core::Internal::NewDialog {name='Core__Internal__NewDialog' type='Core::Internal::NewDialog' visible='1' windowTitle='New'}
|
:New_Core::Internal::NewDialog {name='Core__Internal__NewDialog' type='Core::Internal::NewDialog' visible='1' windowTitle='New'}
|
||||||
@@ -119,6 +121,7 @@
|
|||||||
:Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
:Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||||
:Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
:Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||||
:Qt Creator_ProFileEditorWidget {type='Qt4ProjectManager::Internal::ProFileEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
:Qt Creator_ProFileEditorWidget {type='Qt4ProjectManager::Internal::ProFileEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||||
|
:Qt Creator_PythonEditor::EditorWidget {type='PythonEditor::EditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||||
:Qt Creator_QDeclarativeView {type='QDeclarativeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
:Qt Creator_QDeclarativeView {type='QDeclarativeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||||
:Qt Creator_QHelpContentWidget {type='QHelpContentWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
:Qt Creator_QHelpContentWidget {type='QHelpContentWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||||
:Qt Creator_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
:Qt Creator_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ def getEditorForFileSuffix(curFile):
|
|||||||
qmlEditorSuffixes = ["qml", "qmlproject", "js", "qs", "qtt"]
|
qmlEditorSuffixes = ["qml", "qmlproject", "js", "qs", "qtt"]
|
||||||
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"]
|
||||||
suffix = __getFileSuffix__(curFile)
|
suffix = __getFileSuffix__(curFile)
|
||||||
if suffix in cppEditorSuffixes:
|
if suffix in cppEditorSuffixes:
|
||||||
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||||
@@ -254,6 +255,8 @@ def getEditorForFileSuffix(curFile):
|
|||||||
elif suffix in glslEditorSuffixes:
|
elif suffix in glslEditorSuffixes:
|
||||||
editor = waitForObject("{type='GLSLEditor::GLSLTextEditorWidget' unnamed='1' "
|
editor = waitForObject("{type='GLSLEditor::GLSLTextEditorWidget' unnamed='1' "
|
||||||
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}")
|
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||||
|
elif suffix in pytEditorSuffixes:
|
||||||
|
editor = waitForObject(":Qt Creator_PythonEditor::EditorWidget")
|
||||||
else:
|
else:
|
||||||
test.log("Trying PlainTextEditor (file suffix: %s)" % suffix)
|
test.log("Trying PlainTextEditor (file suffix: %s)" % suffix)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -242,6 +242,18 @@ def __getTargetFromToolTip__(toolTip):
|
|||||||
return None
|
return None
|
||||||
return target.group(1).split("<br/>")[0].strip()
|
return target.group(1).split("<br/>")[0].strip()
|
||||||
|
|
||||||
|
def getExecutableAndTargetFromToolTip(toolTip):
|
||||||
|
target = __getTargetFromToolTip__(toolTip)
|
||||||
|
if toolTip == None or not isinstance(toolTip, (str, unicode)):
|
||||||
|
return None, target
|
||||||
|
pattern = re.compile('.*<b>Run:</b>(.*)</.*')
|
||||||
|
exe = pattern.match(toolTip)
|
||||||
|
if exe == None:
|
||||||
|
test.fatal("UI seems to have changed - expected ToolTip does not match.",
|
||||||
|
"ToolTip: '%s'" % toolTip)
|
||||||
|
return None, target
|
||||||
|
return exe.group(1).strip(), target
|
||||||
|
|
||||||
def __getMkspecFromQMakeCall__(qmakeCall):
|
def __getMkspecFromQMakeCall__(qmakeCall):
|
||||||
qCall = qmakeCall.split("</b>")[1].strip()
|
qCall = qmakeCall.split("</b>")[1].strip()
|
||||||
tmp = qCall.split()
|
tmp = qCall.split()
|
||||||
|
|||||||
@@ -667,3 +667,12 @@ def clickOnTab(tabBarStr, tabText, timeout=5000):
|
|||||||
test.log("Using workaround for Mac.")
|
test.log("Using workaround for Mac.")
|
||||||
setWindowState(tabBar, WindowState.Normal)
|
setWindowState(tabBar, WindowState.Normal)
|
||||||
clickTab(waitForObject(tabBarStr, timeout), tabText)
|
clickTab(waitForObject(tabBarStr, timeout), tabText)
|
||||||
|
|
||||||
|
# constructs a string holding the properties for a QModelIndex
|
||||||
|
# param property a string holding additional properties including their values
|
||||||
|
# ATTENTION! use single quotes for values (e.g. "text='Text'", "text='Text' occurrence='2'")
|
||||||
|
# param container the container (str) to be used for this QModelIndex
|
||||||
|
def getQModelIndexStr(property, container):
|
||||||
|
if (container.startswith(":")):
|
||||||
|
container = "'%s'" % container
|
||||||
|
return ("{column='0' container=%s %s type='QModelIndex'}" % (container, property))
|
||||||
|
|||||||
@@ -89,7 +89,10 @@ def main():
|
|||||||
type(editorWidget, "<Meta+Space>")
|
type(editorWidget, "<Meta+Space>")
|
||||||
else:
|
else:
|
||||||
type(editorWidget, "<Ctrl+Space>")
|
type(editorWidget, "<Ctrl+Space>")
|
||||||
waitForObjectItem(":popupFrame_Proposal_QListView", "return")
|
try:
|
||||||
|
waitForObjectItem(":popupFrame_Proposal_QListView", "return")
|
||||||
|
except:
|
||||||
|
test.fail("Could not find proposal popup.")
|
||||||
type(editorWidget, "<Right>")
|
type(editorWidget, "<Right>")
|
||||||
type(editorWidget, "<Backspace>")
|
type(editorWidget, "<Backspace>")
|
||||||
test.verify(str(editorWidget.plainText).startswith("ret#"),
|
test.verify(str(editorWidget.plainText).startswith("ret#"),
|
||||||
|
|||||||
@@ -44,12 +44,6 @@ def invokeContextMenuItemOnBookmarkFolder(view, item, menuItem):
|
|||||||
activateItem(waitForObject("{aboveWidget=%s type='QMenu' unnamed='1' visible='1' "
|
activateItem(waitForObject("{aboveWidget=%s type='QMenu' unnamed='1' visible='1' "
|
||||||
"window=':Add Bookmark_BookmarkDialog'}" % aboveWidget), menuItem)
|
"window=':Add Bookmark_BookmarkDialog'}" % aboveWidget), menuItem)
|
||||||
|
|
||||||
def getQModelIndexStr(textProperty, container):
|
|
||||||
if (container.startswith(":")):
|
|
||||||
container = "'%s'" % container
|
|
||||||
return ("{column='0' container=%s %s type='QModelIndex'}"
|
|
||||||
% (container, textProperty))
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
|
|||||||
@@ -95,8 +95,10 @@ def testSuggestionsManual(lineText, textToType, expectedText):
|
|||||||
else:
|
else:
|
||||||
type(editorArea, "<Ctrl+Space>")
|
type(editorArea, "<Ctrl+Space>")
|
||||||
# check if suggestions are shown
|
# check if suggestions are shown
|
||||||
test.verify(checkIfObjectExists(":popupFrame_Proposal_QListView"),
|
if not test.verify(checkIfObjectExists(":popupFrame_Proposal_QListView"),
|
||||||
"Verifying if suggestions in manual mode are shown manually")
|
"Verifying if suggestions in manual mode are shown manually"):
|
||||||
|
__endTestSuggestions__(editorArea)
|
||||||
|
return False
|
||||||
# verify proposed suggestions
|
# verify proposed suggestions
|
||||||
verifySuggestions(textToType)
|
verifySuggestions(textToType)
|
||||||
# test if suggestion can be used
|
# test if suggestion can be used
|
||||||
|
|||||||
50
tests/system/suite_debugger/shared/testdata/simpleQuickUI2/simpleQuickUI2.qml
vendored
Normal file
50
tests/system/suite_debugger/shared/testdata/simpleQuickUI2/simpleQuickUI2.qml
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 360
|
||||||
|
height: 360
|
||||||
|
Rectangle {
|
||||||
|
width: 100; height: 100
|
||||||
|
anchors.centerIn: parent
|
||||||
|
color: "red"
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
width: 50; height: 50
|
||||||
|
anchors.centerIn: parent
|
||||||
|
color: "green"
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: "Check"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
15
tests/system/suite_debugger/shared/testdata/simpleQuickUI2/simpleQuickUI2.qmlproject
vendored
Normal file
15
tests/system/suite_debugger/shared/testdata/simpleQuickUI2/simpleQuickUI2.qmlproject
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import QmlProject 1.1
|
||||||
|
|
||||||
|
Project {
|
||||||
|
mainFile: "simpleQuickUI2.qml"
|
||||||
|
|
||||||
|
QmlFiles {
|
||||||
|
directory: "."
|
||||||
|
}
|
||||||
|
JavaScriptFiles {
|
||||||
|
directory: "."
|
||||||
|
}
|
||||||
|
ImageFiles {
|
||||||
|
directory: "."
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
|||||||
IMPLICITAUTSTART=0
|
IMPLICITAUTSTART=0
|
||||||
LANGUAGE=Python
|
LANGUAGE=Python
|
||||||
OBJECTMAP=../objects.map
|
OBJECTMAP=../objects.map
|
||||||
TEST_CASES=tst_build_new_project tst_cli_output_console tst_simple_analyze tst_simple_debug
|
TEST_CASES=tst_build_new_project tst_cli_output_console tst_qml_locals tst_simple_analyze tst_simple_debug
|
||||||
VERSION=2
|
VERSION=2
|
||||||
WRAPPERS=Qt
|
WRAPPERS=Qt
|
||||||
|
|||||||
99
tests/system/suite_debugger/tst_qml_locals/Tree.py
Normal file
99
tests/system/suite_debugger/tst_qml_locals/Tree.py
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
#############################################################################
|
||||||
|
##
|
||||||
|
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
## Contact: http://www.qt-project.org/legal
|
||||||
|
##
|
||||||
|
## This file is part of Qt Creator.
|
||||||
|
##
|
||||||
|
## Commercial License Usage
|
||||||
|
## Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
## accordance with the commercial license agreement provided with the
|
||||||
|
## Software or, alternatively, in accordance with the terms contained in
|
||||||
|
## a written agreement between you and Digia. For licensing terms and
|
||||||
|
## conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
## use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
##
|
||||||
|
## GNU Lesser General Public License Usage
|
||||||
|
## Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
## General Public License version 2.1 as published by the Free Software
|
||||||
|
## Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
## packaging of this file. Please review the following information to
|
||||||
|
## ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
##
|
||||||
|
## In addition, as a special exception, Digia gives you certain additional
|
||||||
|
## rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
##
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Helper class to create a tree structure
|
||||||
|
class Tree:
|
||||||
|
def __init__(self, name=None, value=None, children=None):
|
||||||
|
self.__name__ = name
|
||||||
|
self.__value__ = value
|
||||||
|
self.__children__ = children
|
||||||
|
|
||||||
|
# getter functions
|
||||||
|
def getChild(self, name, occurrence=1):
|
||||||
|
if self.__children__:
|
||||||
|
for ch in self.__children__:
|
||||||
|
if ch.__name__ == name:
|
||||||
|
if occurrence == 1:
|
||||||
|
return ch
|
||||||
|
occurrence -= 1
|
||||||
|
return None
|
||||||
|
|
||||||
|
def getChildren(self):
|
||||||
|
return self.__children__
|
||||||
|
|
||||||
|
def getName(self):
|
||||||
|
return self.__name__
|
||||||
|
|
||||||
|
def getValue(self):
|
||||||
|
return self.__value__
|
||||||
|
|
||||||
|
# setter function
|
||||||
|
def setChildren(self, children):
|
||||||
|
self.__children__ = children
|
||||||
|
|
||||||
|
def setName(self, name):
|
||||||
|
self.__name__ = name
|
||||||
|
|
||||||
|
def setValue(self, value):
|
||||||
|
self.__value__ = value
|
||||||
|
|
||||||
|
# other functions
|
||||||
|
def addChild(self, child):
|
||||||
|
if self.__children__ == None:
|
||||||
|
self.__children__ = []
|
||||||
|
self.__children__.append(child)
|
||||||
|
|
||||||
|
def childrenCount(self):
|
||||||
|
if self.__children__:
|
||||||
|
return len(self.__children__)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def countChildOccurrences(self, name):
|
||||||
|
if not self.__children__:
|
||||||
|
return 0
|
||||||
|
return len(filter(lambda x: x.getName() == name, self.__children__))
|
||||||
|
|
||||||
|
# internal functions
|
||||||
|
def __repr__(self):
|
||||||
|
return self.__str__()
|
||||||
|
|
||||||
|
def __strIndented__(self, indent):
|
||||||
|
result = "%s%s (%s)" % (" " * indent, self.__name__, self.__value__)
|
||||||
|
if self.__children__:
|
||||||
|
for ch in self.__children__:
|
||||||
|
if isinstance(ch, Tree):
|
||||||
|
result += os.linesep + ch.__strIndented__(indent + 2)
|
||||||
|
else:
|
||||||
|
result += os.linesep + " " * (indent + 2) + str(ch)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.__strIndented__(1)
|
||||||
167
tests/system/suite_debugger/tst_qml_locals/test.py
Normal file
167
tests/system/suite_debugger/tst_qml_locals/test.py
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
#############################################################################
|
||||||
|
##
|
||||||
|
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
## Contact: http://www.qt-project.org/legal
|
||||||
|
##
|
||||||
|
## This file is part of Qt Creator.
|
||||||
|
##
|
||||||
|
## Commercial License Usage
|
||||||
|
## Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
## accordance with the commercial license agreement provided with the
|
||||||
|
## Software or, alternatively, in accordance with the terms contained in
|
||||||
|
## a written agreement between you and Digia. For licensing terms and
|
||||||
|
## conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
## use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
##
|
||||||
|
## GNU Lesser General Public License Usage
|
||||||
|
## Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
## General Public License version 2.1 as published by the Free Software
|
||||||
|
## Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
## packaging of this file. Please review the following information to
|
||||||
|
## ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
##
|
||||||
|
## In addition, as a special exception, Digia gives you certain additional
|
||||||
|
## rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
##
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
source("../../shared/qtcreator.py")
|
||||||
|
source("Tree.py")
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if os.getenv("SYSTEST_OPENGL_MISSING") == "1":
|
||||||
|
test.xverify(False, "This test needs OpenGL - skipping...")
|
||||||
|
return
|
||||||
|
projName = "simpleQuickUI2.qmlproject"
|
||||||
|
projFolder = os.path.dirname(findFile("testdata", "simpleQuickUI2/%s" % projName))
|
||||||
|
if not neededFilePresent(os.path.join(projFolder, projName)):
|
||||||
|
return
|
||||||
|
qmlProjDir = prepareTemplate(projFolder)
|
||||||
|
if qmlProjDir == None:
|
||||||
|
test.fatal("Could not prepare test files - leaving test")
|
||||||
|
return
|
||||||
|
qmlProjFile = os.path.join(qmlProjDir, projName)
|
||||||
|
# start Creator by passing a .qmlproject file
|
||||||
|
startApplication('qtcreator' + SettingsPath + ' "%s"' % qmlProjFile)
|
||||||
|
if not startedWithoutPluginError():
|
||||||
|
return
|
||||||
|
fancyConfButton = findObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
||||||
|
fancyRunButton = findObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
|
||||||
|
fancyDebugButton = findObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton")
|
||||||
|
exe, target = getExecutableAndTargetFromToolTip(str(waitForObject(fancyConfButton).toolTip))
|
||||||
|
if not (test.verify(fancyRunButton.enabled and fancyDebugButton.enabled,
|
||||||
|
"Verifying Run and Debug are enabled (Qt5 is available).")
|
||||||
|
and test.compare(target, Targets.getStringForTarget(Targets.DESKTOP_501_DEFAULT),
|
||||||
|
"Verifying selected Target is Qt5.")
|
||||||
|
and test.compare(exe, "QML Scene", "Verifying selected executable is QML Scene.")):
|
||||||
|
earlyExit("Something went wrong opening Qml project - probably missing Qt5.")
|
||||||
|
return
|
||||||
|
switchViewTo(ViewConstants.PROJECTS)
|
||||||
|
switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.RUN, True)
|
||||||
|
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' "
|
||||||
|
"type='QCheckBox' unnamed='1' visible='1'}")
|
||||||
|
switchViewTo(ViewConstants.EDIT)
|
||||||
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
|
qmake = getQtInformationForQmlProject()[3]
|
||||||
|
if qmake == None:
|
||||||
|
earlyExit("Could not figure out which qmake is used.")
|
||||||
|
return
|
||||||
|
qmlScenePath = os.path.abspath(os.path.dirname(qmake))
|
||||||
|
qmlScene = "qmlscene.exe"
|
||||||
|
allowAppThroughWinFW(qmlScenePath, qmlScene, None)
|
||||||
|
clickButton(fancyDebugButton)
|
||||||
|
locAndExprTV = waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView")
|
||||||
|
# Locals and Expressions populates treeview only on demand - so the tree must be expanded
|
||||||
|
__unfoldTree__()
|
||||||
|
items = fetchItems(QModelIndex(), QModelIndex(), locAndExprTV)
|
||||||
|
# reduce items to Locals (invisible object)
|
||||||
|
items = items.getChild("Inspector")
|
||||||
|
if items == None:
|
||||||
|
earlyExit("Could not find expected Inspector tree inside Locals and Expressions.")
|
||||||
|
return
|
||||||
|
# reduce items to outer Rectangle object
|
||||||
|
items = items.getChild("Rectangle")
|
||||||
|
if items == None:
|
||||||
|
earlyExit("Could not find expected Rectangle tree inside Locals and Expressions.")
|
||||||
|
return
|
||||||
|
checkForEmptyRows(items)
|
||||||
|
check = [[None, 0, {"Properties":1, "Rectangle":2, "Text":1}, {"width":"360", "height":"360"}],
|
||||||
|
["Text", 1, {"Properties":1}, {"text":"Check"}],
|
||||||
|
["Rectangle", 1, {"Properties":1}, {"width":"50", "height":"50", "color":"#008000"}],
|
||||||
|
["Rectangle", 2, {"Properties":1}, {"width":"100", "height":"100", "color":"#ff0000"}]
|
||||||
|
]
|
||||||
|
for current in check:
|
||||||
|
if current[0]:
|
||||||
|
subItem = items.getChild(current[0], current[1])
|
||||||
|
else:
|
||||||
|
subItem = items
|
||||||
|
checkForExpectedValues(subItem, current[2], current[3])
|
||||||
|
clickButton(waitForObject(':Debugger Toolbar.Exit Debugger_QToolButton', 5000))
|
||||||
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
|
deleteAppFromWinFW(qmlScenePath, qmlScene)
|
||||||
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
|
def __unfoldTree__():
|
||||||
|
rootIndex = getQModelIndexStr("text='Rectangle'",
|
||||||
|
':Locals and Expressions_Debugger::Internal::WatchTreeView')
|
||||||
|
unfoldQModelIndexIncludingProperties(rootIndex)
|
||||||
|
subItems = ["text='Rectangle' occurrence='2'", "text='Rectangle'", "text='Text'"]
|
||||||
|
for item in subItems:
|
||||||
|
unfoldQModelIndexIncludingProperties(getQModelIndexStr(item, rootIndex))
|
||||||
|
|
||||||
|
def unfoldQModelIndexIncludingProperties(indexStr):
|
||||||
|
doubleClick(waitForObject(indexStr))
|
||||||
|
propIndex = getQModelIndexStr("text='Properties'", indexStr)
|
||||||
|
doubleClick(waitForObject(propIndex))
|
||||||
|
|
||||||
|
def fetchItems(index, valIndex, treeView):
|
||||||
|
tree = Tree()
|
||||||
|
model = treeView.model()
|
||||||
|
if index.isValid():
|
||||||
|
name = str(model.data(index).toString())
|
||||||
|
value = str(model.data(valIndex).toString())
|
||||||
|
tree.setName(name)
|
||||||
|
tree.setValue(value)
|
||||||
|
for row in range(model.rowCount(index)):
|
||||||
|
tree.addChild(fetchItems(model.index(row, 0, index), model.index(row, 1, index), treeView))
|
||||||
|
return tree
|
||||||
|
|
||||||
|
def checkForEmptyRows(items, isRootCheck=True):
|
||||||
|
# check for QTCREATORBUG-9069
|
||||||
|
noEmptyRowsFound = True
|
||||||
|
if items.getName().strip() == "":
|
||||||
|
noEmptyRowsFound = False
|
||||||
|
test.fail('Found empty row inside Locals and Expressions', '%s' % items)
|
||||||
|
if items.childrenCount():
|
||||||
|
for item in items.getChildren():
|
||||||
|
noEmptyRowsFound &= checkForEmptyRows(item, False)
|
||||||
|
if isRootCheck and noEmptyRowsFound:
|
||||||
|
test.passes("No empty rows inside Locals and Expressions found.")
|
||||||
|
return noEmptyRowsFound
|
||||||
|
|
||||||
|
def checkForExpectedValues(items, expectedChildren, expectedProperties):
|
||||||
|
if items == None:
|
||||||
|
test.fatal("Got a None object to inspect")
|
||||||
|
return
|
||||||
|
for subItemName in expectedChildren.keys():
|
||||||
|
test.compare(items.countChildOccurrences(subItemName), expectedChildren[subItemName],
|
||||||
|
"Verify number of children named %s for %s" % (subItemName, items.getName()))
|
||||||
|
properties = items.getChild("Properties")
|
||||||
|
if properties:
|
||||||
|
children = properties.getChildren()
|
||||||
|
for property,value in expectedProperties.iteritems():
|
||||||
|
foundProperty = getProperty(property, children)
|
||||||
|
if foundProperty:
|
||||||
|
test.compare(foundProperty.getValue(), value, "Verifying value for %s" % property)
|
||||||
|
else:
|
||||||
|
test.fail("Could not find property %s for object %s" % (property, items.getName()))
|
||||||
|
else:
|
||||||
|
test.fail("Missing properties for %s" % items.getName())
|
||||||
|
|
||||||
|
def getProperty(property, propertyList):
|
||||||
|
for prop in propertyList:
|
||||||
|
if prop.getName() == property:
|
||||||
|
return prop
|
||||||
|
return None
|
||||||
@@ -6,3 +6,4 @@
|
|||||||
"creator/tests/manual/cplusplus-frontend/conf.c++"
|
"creator/tests/manual/cplusplus-frontend/conf.c++"
|
||||||
"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"
|
||||||
|
|||||||
|
Reference in New Issue
Block a user