Commit 1776cee6 authored by Robert Loehning's avatar Robert Loehning Committed by Christian Stenger
Browse files

Squish: Check for elements in project tree



Change-Id: I11a74d6d9703871b20f9c0a59bf613717e6553ef
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent 79ca1f3d
import __builtin__
import re
processStarted = False
......@@ -467,3 +468,40 @@ def prepareTemplate(sourceExample):
templateDir = os.path.abspath(tempDir() + "/template")
shutil.copytree(sourceExample, templateDir)
return templateDir
def __iterateChildren__(model, parent, nestingLevel=0):
children = []
for currentIndex in [model.index(row, 0, parent) for row in range(model.rowCount(parent))]:
children.append([str(currentIndex.text), nestingLevel])
if model.hasChildren(currentIndex):
children.extend(__iterateChildren__(model, currentIndex, nestingLevel + 1))
return children
# This will write the data to a file which can then be used for comparing
def __writeProjectTreeFile__(projectTree, filename):
f = open(filename, "w+")
f.write('"text"\t"nestinglevel"\n')
for elem in projectTree:
f.write('"%s"\t"%s"\n' % (elem[0], elem[1]))
f.close()
def __getTestData__(record):
return [testData.field(record, "text"),
__builtin__.int(testData.field(record, "nestinglevel"))]
def compareProjectTree(rootObject, dataset):
root = waitForObject(rootObject)
tree = __iterateChildren__(root.model(), root)
# __writeProjectTreeFile__(tree, dataset)
for i, current in enumerate(map(__getTestData__, testData.dataset(dataset))):
try:
# Just removing everything up to the found item
# Writing a pass would result in truly massive logs
tree = tree[tree.index(current) + 1:]
except ValueError:
test.fail('Could not find "%s" with nesting level %s' % tuple(current),
'Line %s in dataset' % str(i + 1))
return
test.passes("No errors found in project tree")
......@@ -15,6 +15,10 @@ def main():
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 300000)
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text='%s' type='QModelIndex'}"
compareProjectTree(naviTreeView % "speedcrunch", "projecttree_speedcrunch.tsv")
compareProjectTree(naviTreeView % "qtcreator", "projecttree_creator.tsv")
# Now check some basic lookups in the search box
selectFromLocator(": Qlist::QList", "QList::QList")
test.compare(wordUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "QList")
......
"text" "nestinglevel"
"qtcreator.pro" "0"
"bin" "0"
"bin.pro" "1"
"Other files" "1"
"qtcreator.sh" "2"
"doc" "0"
"doc.pri" "1"
"Other files" "1"
"api" "2"
"coding-style.qdoc" "3"
"creating-plugins.qdoc" "3"
"external-tool-spec.qdoc" "3"
"first-plugin.qdoc" "3"
"getting-and-building.qdoc" "3"
"plugin-lifecycle.qdoc" "3"
"plugin-specifications.qdoc" "3"
"qtcreator-api.qdoc" "3"
"qtcreator-dev-wizards.qdoc" "3"
"qtcreator-dev.qdoc" "3"
"qtcreator-dev.qdocconf" "3"
"config" "2"
"compat.qdocconf" "3"
"macros.qdocconf" "3"
"qt-cpp-ignore.qdocconf" "3"
"qt-defines.qdocconf" "3"
"qt-html-default-styles.qdocconf" "3"
"qt-html-templates.qdocconf" "3"
"src" "2"
"qtcreator.qdoc" "3"
"addressbook-sdk.qdoc" "2"
"qtcreator.qdocconf" "2"
"qtcomponents" "0"
"qtcomponents.pro" "1"
"qtcreator" "1"
"qtcreator.pri" "2"
"QML" "1"
"custom" "2"
"behaviors" "3"
"ButtonBehavior.qml" "4"
"ModalPopupBehavior.qml" "4"
"private" "3"
"ChoiceListPopup.qml" "4"
"BasicButton.qml" "3"
"Button.qml" "3"
"ButtonColumn.qml" "3"
"ButtonRow.qml" "3"
"CheckBox.qml" "3"
"ChoiceList.qml" "3"
"GroupBox.qml" "3"
"ProgressBar.qml" "3"
"Slider.qml" "3"
"SpinBox.qml" "3"
"SplitterRow.qml" "3"
"TextField.qml" "3"
"Button.qml" "2"
"ButtonRow.qml" "2"
"CheckBox.qml" "2"
"ChoiceList.qml" "2"
"ContextMenu.qml" "2"
"Dial.qml" "2"
"Frame.qml" "2"
"GroupBox.qml" "2"
"Menu.qml" "2"
"MenuItem.qml" "2"
"ProgressBar.qml" "2"
"RadioButton.qml" "2"
"ScrollArea.qml" "2"
"ScrollBar.qml" "2"
"Slider.qml" "2"
"SpinBox.qml" "2"
"SplitterRow.qml" "2"
"Switch.qml" "2"
"Tab.qml" "2"
"TabBar.qml" "2"
"TabFrame.qml" "2"
"TableColumn.qml" "2"
"TableView.qml" "2"
"TextArea.qml" "2"
"TextField.qml" "2"
"ToolBar.qml" "2"
"ToolButton.qml" "2"
"Other files" "1"
"custom" "2"
"ButtonGroup.js" "3"
"components.pro" "3"
"qmldir" "3"
"images" "2"
"folder_new.png" "3"
"qmldir" "2"
"qtcreator" "0"
"qtcreator.pri" "1"
"share" "0"
"share.pro" "1"
"static" "1"
"static.pro" "2"
"qtcreator" "2"
"qtcreator.pri" "3"
"QML" "2"
"qml/qmlobserver" "3"
"browser" "4"
"Browser.qml" "5"
"startup" "4"
"Logo.qml" "5"
"startup.qml" "5"
"qmldesigner/propertyeditor" "3"
"Qt" "4"
"AlignmentHorizontalButtons.qml" "5"
"AlignmentVerticalButtons.qml" "5"
"AnchorBox.qml" "5"
"AnchorButtons.qml" "5"
"BorderImageSpecifics.qml" "5"
"CheckBox.qml" "5"
"ColorGroupBox.qml" "5"
"ColorLabel.qml" "5"
"ColorScheme.qml" "5"
"ColorTypeButtons.qml" "5"
"ComboBox.qml" "5"
"DoubleSpinBox.qml" "5"
"DoubleSpinBoxAlternate.qml" "5"
"emptyPane.qml" "5"
"ExpressionEditor.qml" "5"
"Extended.qml" "5"
"ExtendedFunctionButton.qml" "5"
"ExtendedPane.qml" "5"
"ExtendedSwitches.qml" "5"
"FlagedButton.qml" "5"
"FlickableGroupBox.qml" "5"
"FlickableSpecifics.qml" "5"
"FlipableSpecifics.qml" "5"
"FlowSpecifics.qml" "5"
"FontComboBox.qml" "5"
"FontGroupBox.qml" "5"
"FontStyleButtons.qml" "5"
"Geometry.qml" "5"
"GridSpecifics.qml" "5"
"GridViewSpecifics.qml" "5"
"GroupBox.qml" "5"
"GroupBoxOption.qml" "5"
"HorizontalLayout.qml" "5"
"HorizontalWhiteLine.qml" "5"
"ImageSpecifics.qml" "5"
"IntEditor.qml" "5"
"ItemPane.qml" "5"
"Label.qml" "5"
"Layout.qml" "5"
"LayoutPane.qml" "5"
"LineEdit.qml" "5"
"ListViewSpecifics.qml" "5"
"Modifiers.qml" "5"
"MouseAreaSpecifics.qml" "5"
"PathViewSpecifics.qml" "5"
"PlaceHolder.qml" "5"
"PropertyFrame.qml" "5"
"RectangleColorGroupBox.qml" "5"
"RectangleSpecifics.qml" "5"
"RowSpecifics.qml" "5"
"ScrollArea.qml" "5"
"SliderWidget.qml" "5"
"SpinBox.qml" "5"
"StandardTextColorGroupBox.qml" "5"
"StandardTextGroupBox.qml" "5"
"Switches.qml" "5"
"TextEditor.qml" "5"
"TextEditSpecifics.qml" "5"
"TextInputGroupBox.qml" "5"
"TextInputSpecifics.qml" "5"
"TextSpecifics.qml" "5"
"Transformation.qml" "5"
"Type.qml" "5"
"VerticalLayout.qml" "5"
"Visibility.qml" "5"
"QtWebKit" "4"
"WebViewSpecifics.qml" "5"
"templates/qtquickapp/qml/app" "3"
"meego10" "4"
"main.qml" "5"
"MainPage.qml" "5"
"qtquick10" "4"
"main.qml" "5"
"symbian11" "4"
"main.qml" "5"
"MainPage.qml" "5"
"welcomescreen" "3"
"dummydata" "4"
"examplesModel.qml" "5"
"pagesModel.qml" "5"
"projectList.qml" "5"
"sessionList.qml" "5"
"tutorialsModel.qml" "5"
"widgets" "4"
"dummydata" "5"
"context" "6"
"ExampleDelegate.qml" "7"
"ExampleGridView.qml" "7"
"examplesModel.qml" "6"
"mockupTags.qml" "6"
"pagesModel.qml" "6"
"tabsModel.qml" "6"
"CustomColors.qml" "5"
"CustomFonts.qml" "5"
"CustomizedGridView.qml" "5"
"CustomTab.qml" "5"
"Delegate.qml" "5"
"Feedback.qml" "5"
"GettingStartedItem.qml" "5"
"LinkedText.qml" "5"
"LinksBar.qml" "5"
"Logo.qml" "5"
"PageCaption.qml" "5"
"PageLoader.qml" "5"
"ProjectItem.qml" "5"
"RecentProjects.qml" "5"
"SearchBar.qml" "5"
"SessionItem.qml" "5"
"Sessions.qml" "5"
"ToolTip.qml" "5"
"develop.qml" "4"
"examples.qml" "4"
"gettingstarted.qml" "4"
"tutorials.qml" "4"
"welcomescreen.qml" "4"
"Other files" "2"
"designer" "3"
"templates" "4"
"Dialog_with_Buttons_Bottom.ui" "5"
"Dialog_with_Buttons_Right.ui" "5"
"Dialog_without_Buttons.ui" "5"
"Main_Window.ui" "5"
"Widget.ui" "5"
"templates.xml" "4"
"dumper" "3"
"test" "4"
"dumpertest.pro" "5"
"main.cpp" "5"
"bridge.py" "4"
"dumper.cpp" "4"
"dumper.h" "4"
"dumper.pro" "4"
"dumper.py" "4"
"dumper_p.h" "4"
"LGPL_EXCEPTION.TXT" "4"
"LICENSE.LGPL" "4"
"pdumper.py" "4"
"qttypes.py" "4"
"generic-highlighter" "3"
"alert.xml" "4"
"autoconf.xml" "4"
"bash.xml" "4"
"cmake.xml" "4"
"css.xml" "4"
"doxygen.xml" "4"
"dtd.xml" "4"
"html.xml" "4"
"ini.xml" "4"
"java.xml" "4"
"javadoc.xml" "4"
"perl.xml" "4"
"ruby.xml" "4"
"valgrind-suppression.xml" "4"
"xml.xml" "4"
"yacc.xml" "4"
"glsl" "3"
"glsl_120.frag" "4"
"glsl_120.vert" "4"
"glsl_120_common.glsl" "4"
"glsl_es_100.frag" "4"
"glsl_es_100.vert" "4"
"glsl_es_100_common.glsl" "4"
"qml" "3"
"qmldump" "4"
"LGPL_EXCEPTION.TXT" "5"
"LICENSE.LGPL" "5"
"main.cpp" "5"
"qmldump.pro" "5"
"qmlstreamwriter.cpp" "5"
"qmlstreamwriter.h" "5"
"qmljsdebugger" "4"
"editor" "5"
"abstractliveedittool.cpp" "6"
"abstractliveedittool.h" "6"
"boundingrecthighlighter.cpp" "6"
"boundingrecthighlighter.h" "6"
"colorpickertool.cpp" "6"
"colorpickertool.h" "6"
"livelayeritem.cpp" "6"
"livelayeritem.h" "6"
"liverubberbandselectionmanipulator.cpp" "6"
"liverubberbandselectionmanipulator.h" "6"
"liveselectionindicator.cpp" "6"
"liveselectionindicator.h" "6"
"liveselectionrectangle.cpp" "6"
"liveselectionrectangle.h" "6"
"liveselectiontool.cpp" "6"
"liveselectiontool.h" "6"
"livesingleselectionmanipulator.cpp" "6"
"livesingleselectionmanipulator.h" "6"
"subcomponentmasklayeritem.cpp" "6"
"subcomponentmasklayeritem.h" "6"
"zoomtool.cpp" "6"
"zoomtool.h" "6"
"include" "5"
"qt_private" "6"
"qdeclarativedebughelper_p.h" "7"
"qdeclarativedebugservice_p.h" "7"
"qdeclarativestate_p.h" "7"
"jsdebuggeragent.h" "6"
"qdeclarativeinspectorservice.h" "6"
"qdeclarativeviewinspector.h" "6"
"qdeclarativeviewobserver.h" "6"
"qmlinspectorconstants.h" "6"
"qmljsdebugger_global.h" "6"
"protocol" "5"
"inspectorprotocol.h" "6"
"protocol.pri" "6"
"jsdebuggeragent.cpp" "5"
"qdeclarativeinspectorservice.cpp" "5"
"qdeclarativeviewinspector.cpp" "5"
"qdeclarativeviewinspector_p.h" "5"
"qmljsdebugger-lib.pri" "5"
"qmljsdebugger-src.pri" "5"
"qmljsdebugger.pro" "5"
"qmlobserver" "4"
"browser" "5"
"images" "6"
"folder.png" "7"
"titlebar.png" "7"
"titlebar.sci" "7"
"up.png" "7"
"browser.qrc" "6"
"startup" "5"
"qt-back.png" "6"
"qt-blue.jpg" "6"
"qt-front.png" "6"
"qt-sketch.jpg" "6"
"qt-text.png" "6"
"quick-blur.png" "6"
"quick-regular.png" "6"
"shadow.png" "6"
"startup.qrc" "6"
"white-star.png" "6"
"deviceorientation.cpp" "5"
"deviceorientation.h" "5"
"deviceorientation_harmattan.cpp" "5"
"deviceorientation_maemo5.cpp" "5"
"deviceorientation_symbian.cpp" "5"
"LGPL_EXCEPTION.TXT" "5"
"LICENSE.LGPL" "5"
"loggerwidget.cpp" "5"
"loggerwidget.h" "5"
"main.cpp" "5"
"proxysettings.cpp" "5"
"proxysettings.h" "5"
"proxysettings.ui" "5"
"proxysettings_maemo5.ui" "5"
"qdeclarativetester.cpp" "5"
"qdeclarativetester.h" "5"
"qml.icns" "5"
"qml.pri" "5"
"qmlobserver.pro" "5"
"qmlruntime.cpp" "5"
"qmlruntime.h" "5"
"recopts.ui" "5"
"recopts_maemo5.ui" "5"
"texteditautoresizer_maemo5.h" "5"
"qmlpuppet" "4"
"commands" "5"
"changeauxiliarycommand.cpp" "6"
"changeauxiliarycommand.h" "6"
"changebindingscommand.cpp" "6"
"changebindingscommand.h" "6"
"changefileurlcommand.cpp" "6"
"changefileurlcommand.h" "6"
"changeidscommand.cpp" "6"
"changeidscommand.h" "6"
"changenodesourcecommand.cpp" "6"
"changenodesourcecommand.h" "6"
"changestatecommand.cpp" "6"
"changestatecommand.h" "6"
"changevaluescommand.cpp" "6"
"changevaluescommand.h" "6"
"childrenchangedcommand.cpp" "6"
"childrenchangedcommand.h" "6"
"clearscenecommand.cpp" "6"
"clearscenecommand.h" "6"
"commands.pri" "6"
"completecomponentcommand.cpp" "6"
"completecomponentcommand.h" "6"
"componentcompletedcommand.cpp" "6"
"componentcompletedcommand.h" "6"
"createinstancescommand.cpp" "6"
"createinstancescommand.h" "6"
"createscenecommand.cpp" "6"
"createscenecommand.h" "6"
"informationchangedcommand.cpp" "6"
"informationchangedcommand.h" "6"
"pixmapchangedcommand.cpp" "6"
"pixmapchangedcommand.h" "6"
"removeinstancescommand.cpp" "6"
"removeinstancescommand.h" "6"
"removepropertiescommand.cpp" "6"
"removepropertiescommand.h" "6"
"reparentinstancescommand.cpp" "6"
"reparentinstancescommand.h" "6"
"statepreviewimagechangedcommand.cpp" "6"
"statepreviewimagechangedcommand.h" "6"
"synchronizecommand.cpp" "6"
"synchronizecommand.h" "6"
"tokencommand.cpp" "6"
"tokencommand.h" "6"
"valueschangedcommand.cpp" "6"
"valueschangedcommand.h" "6"
"container" "5"
"addimportcontainer.cpp" "6"
"addimportcontainer.h" "6"
"container.pri" "6"
"idcontainer.cpp" "6"
"idcontainer.h" "6"
"imagecontainer.cpp" "6"
"imagecontainer.h" "6"
"informationcontainer.cpp" "6"
"informationcontainer.h" "6"
"instancecontainer.cpp" "6"
"instancecontainer.h" "6"
"propertyabstractcontainer.cpp" "6"
"propertyabstractcontainer.h" "6"
"propertybindingcontainer.cpp" "6"
"propertybindingcontainer.h" "6"
"propertyvaluecontainer.cpp" "6"
"propertyvaluecontainer.h" "6"
"reparentcontainer.cpp" "6"
"reparentcontainer.h" "6"
"html" "5"
"welcome.html" "6"
"images" "5"
"template_image.png" "6"
"webkit.png" "6"
"instances" "5"
"anchorchangesnodeinstance.cpp" "6"
"anchorchangesnodeinstance.h" "6"
"behaviornodeinstance.cpp" "6"
"behaviornodeinstance.h" "6"
"childrenchangeeventfilter.cpp" "6"
"childrenchangeeventfilter.h" "6"
"componentnodeinstance.cpp" "6"
"componentnodeinstance.h" "6"
"dummycontextobject.cpp" "6"
"dummycontextobject.h" "6"
"dummynodeinstance.cpp" "6"
"dummynodeinstance.h" "6"
"instances.pri" "6"
"nodeinstanceclientproxy.cpp" "6"
"nodeinstanceclientproxy.h" "6"
"nodeinstancemetaobject.cpp" "6"
"nodeinstancemetaobject.h" "6"
"nodeinstanceserver.cpp" "6"
"nodeinstanceserver.h" "6"
"nodeinstancesignalspy.cpp" "6"
"nodeinstancesignalspy.h" "6"
"objectnodeinstance.cpp" "6"
"objectnodeinstance.h" "6"
"qmlpropertychangesnodeinstance.cpp" "6"
"qmlpropertychangesnodeinstance.h" "6"
"qmlstatenodeinstance.cpp" "6"
"qmlstatenodeinstance.h" "6"
"qmltransitionnodeinstance.cpp" "6"
"qmltransitionnodeinstance.h" "6"
"servernodeinstance.cpp" "6"
"servernodeinstance.h" "6"
"interfaces" "5"
"commondefines.h" "6"
"interfaces.pri" "6"
"nodeinstanceclientinterface.h" "6"
"nodeinstanceserverinterface.cpp" "6"
"nodeinstanceserverinterface.h" "6"
"qml2puppet" "5"
"instances" "6"
"instances.pri" "7"
"qt5informationnodeinstanceserver.cpp" "7"
"qt5informationnodeinstanceserver.h" "7"
"qt5nodeinstanceclientproxy.cpp" "7"
"qt5nodeinstanceclientproxy.h" "7"
"qt5nodeinstanceserver.cpp" "7"
"qt5nodeinstanceserver.h" "7"
"qt5previewnodeinstanceserver.cpp" "7"
"qt5previewnodeinstanceserver.h" "7"
"qt5rendernodeinstanceserver.cpp" "7"
"qt5rendernodeinstanceserver.h" "7"
"sgitemnodeinstance.cpp" "7"
"sgitemnodeinstance.h" "7"
"main.cpp" "6"
"qml2puppet.pro" "6"
"qmlpuppet" "5"
"instances" "6"
"graphicsobjectnodeinstance.cpp" "7"
"graphicsobjectnodeinstance.h" "7"
"instances.pri" "7"
"positionernodeinstance.cpp" "7"
"positionernodeinstance.h" "7"
"qmlgraphicsitemnodeinstance.cpp" "7"
"qmlgraphicsitemnodeinstance.h" "7"
"qt4informationnodeinstanceserver.cpp" "7"
"qt4informationnodeinstanceserver.h" "7"
"qt4nodeinstanceclientproxy.cpp" "7"
"qt4nodeinstanceclientproxy.h" "7"
"qt4nodeinstanceserver.cpp" "7"
"qt4nodeinstanceserver.h" "7"
"qt4previewnodeinstanceserver.cpp" "7"
"qt4previewnodeinstanceserver.h" "7"
"qt4rendernodeinstanceserver.cpp" "7"
"qt4rendernodeinstanceserver.h" "7"
"main.cpp" "6"
"qmlpuppet.pri" "6"
"qmlpuppet.pro" "6"
"qmlpuppet.pro" "5"
"qmlpuppet.qrc" "5"
"qmlpuppet_utilities.pri" "5"
"qml-type-descriptions" "3"
"builtins.qmltypes" "4"
"qmlproject.qmltypes" "4"
"qmlruntime.qmltypes" "4"
"qt-labs-folderlistmodel.qmltypes" "4"
"qt-labs-gestures.qmltypes" "4"
"qt-labs-particles.qmltypes" "4"
"qtmobility-connectivity.qmltypes" "4"
"qtmobility-contacts.qmltypes" "4"
"qtmobility-feedback.qmltypes" "4"
"qtmobility-gallery.qmltypes" "4"
"qtmobility-location.qmltypes" "4"
"qtmobility-messaging.qmltypes" "4"
"qtmobility-organizer.qmltypes" "4"
"qtmobility-publishsubscribe.qmltypes" "4"
"qtmobility-sensors.qmltypes" "4"
"qtmobility-serviceframework.qmltypes" "4"
"qtmobility-systeminfo.qmltypes" "4"
"qtmultimediakit.qmltypes" "4"
"qtwebkit.qmltypes" "4"
"qmldesigner/propertyeditor/Qt" "3"
"images" "4"
"alignmentbottom-h-icon.png" "5"
"alignmentbottom-icon.png" "5"
"alignmentcenterh-h-icon.png" "5"
"alignmentcenterh-icon.png" "5"
"alignmentleft-h-icon.png" "5"
"alignmentleft-icon.png" "5"
"alignmentmiddle-h-icon.png" "5"
"alignmentmiddle-icon.png" "5"
"alignmentright-h-icon.png" "5"
"alignmentright-icon.png" "5"
"alignmenttop-h-icon.png" "5"
"alignmenttop-icon.png" "5"
"apply.png" "5"
"behaivour.png" "5"