Commit 6f5ce197 authored by Robert Loehning's avatar Robert Loehning

Squish: Added tst_simple_analyze

Change-Id: I65a6bff6e99ad608639b26452e6700d28e8fbe0a
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent d67bf484
......@@ -2,8 +2,12 @@
:*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Continue_Core::Internal::FancyToolButton {text='Continue' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.DoubleTabWidget_ProjectExplorer::Internal::DoubleTabWidget {name='ProjectExplorer__Internal__DoubleTabWidget' type='ProjectExplorer::Internal::DoubleTabWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='DoubleTabWidget'}
:*Qt Creator.Events_QDockWidget {name='QmlProfilerEventsViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Events'}
:*Qt Creator.Events_QTabBar {aboveWidget=':*Qt Creator.Events_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Find_Find::Internal::FindToolBar {name='Find__Internal__FindWidget' type='Find::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'}
:*Qt Creator.Interrupt_Core::Internal::FancyToolButton {text='Interrupt' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.JavaScript_QDockWidget {name='QmlProfilerV8ProfileViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='JavaScript'}
:*Qt Creator.JavaScript_QTabBar {aboveWidget=':*Qt Creator.JavaScript_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Start Debugging_Core::Internal::FancyToolButton {text='Start Debugging' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator_Core::Internal::FancyToolButton {occurrence='3' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
......@@ -19,6 +23,9 @@
:Add Bookmark_BookmarkDialog {name='BookmarkDialog' type='BookmarkDialog' visible='1' windowTitle='Add Bookmark'}
:Add to Version Control.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':Add to Version Control_QMessageBox'}
:Add to Version Control_QMessageBox {text~='Add the file.*to version control (.*)?' type='QMessageBox' unnamed='1' visible='1'}
:Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox {container=':Qt Creator.Analyzer Toolbar_QDockWidget' name='AnalyzerManagerToolBox' type='QComboBox' visible='1'}
:Analyzer Toolbar.Elapsed:_QLabel {container=':Qt Creator.Analyzer Toolbar_QDockWidget' text~='Elapsed: \\\\d+.\\\\d s' type='QLabel' unnamed='1' visible='1'}
:Analyzer Toolbar.Start_QToolButton {container=':Qt Creator.Analyzer Toolbar_QDockWidget' text='Start' type='QToolButton' unnamed='1' visible='1'}
:Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'}
:Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'}
:Breakpoints_Debugger::Internal::BreakTreeView {container=':DebugModeWidget.Breakpoints_QDockWidget' type='Debugger::Internal::BreakTreeView' unnamed='1' visible='1'}
......@@ -44,6 +51,7 @@
:Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog_QmlJSEditor::Internal::ComponentNameDialog {name='QmlJSEditor__Internal__ComponentNameDialog' type='QmlJSEditor::Internal::ComponentNameDialog' visible='1' windowTitle='Move Component into Separate File'}
:Edit Environment_ProjectExplorer::EnvironmentItemsDialog {type='ProjectExplorer::EnvironmentItemsDialog' unnamed='1' visible='1' windowTitle='Edit Environment'}
:Events.QmlProfilerEventsTable_QmlProfiler::Internal::QmlProfilerEventsMainView {container=':*Qt Creator.Events_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QmlProfilerEventsMainView' visible='1'}
:Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'}
:File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
:File has been removed.Save_QPushButton {text='Save' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
......@@ -55,6 +63,7 @@
:Installed Plugins.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'}
:Installed Plugins.categoryWidget_QTreeWidget {name='categoryWidget' type='QTreeWidget' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'}
:Installed Plugins_Core::Internal::PluginDialog {type='Core::Internal::PluginDialog' unnamed='1' visible='1' windowTitle='Installed Plugins'}
: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_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='4' type='QComboBox' unnamed='1' visible='1'}
:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
......
......@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_build_new_project tst_cli_output_console tst_simple_debug
TEST_CASES=tst_build_new_project tst_cli_output_console tst_simple_analyze tst_simple_debug
VERSION=2
WRAPPERS=Qt
source("../../shared/qtcreator.py")
workingDir = None
def main():
global workingDir
startApplication("qtcreator" + SettingsPath)
targets = [QtQuickConstants.Targets.DESKTOP_474_GCC]
if platform.system() in ('Windows', 'Microsoft'):
targets.append(QtQuickConstants.Targets.DESKTOP_474_MSVC2008)
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
checkedTargets, projectName = createNewQtQuickApplication(workingDir)
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
if placeCursorToLine(editor, "MouseArea.*", True):
type(editor, '<Up>')
type(editor, '<Return>')
typeLines(editor, ['Timer {',
'interval: 2000',
'repeat: true',
'running: true',
'onTriggered: {',
'var i;',
'for (i = 1; i < 2500; ++i) {',
'var j = i * i;',
'console.log(j);'])
invokeMenuItem("File", "Save All")
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (need Qt 4.7.4) - leaving without debugging.")
for kit, config in availableConfigs:
test.log("Selecting '%s' as build config" % config)
selectBuildConfig(len(checkedTargets), kit, config)
verifyBuildConfig(len(checkedTargets), kit, True, enableQmlDebug=True)
# explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}",
"buildQueueFinished(bool)")
if not checkCompile():
test.fatal("Compile had errors... Skipping current build config")
continue
allowAppThroughWinFW(workingDir, projectName, False)
switchViewTo(ViewConstants.ANALYZE)
selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler")
clickButton(waitForObject(":Analyzer Toolbar.Start_QToolButton"))
stopButton = waitForObject(":Qt Creator.Stop_QToolButton")
elapsedLabel = waitForObject(":Analyzer Toolbar.Elapsed:_QLabel", 3000)
waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000)
clickButton(stopButton)
if safeClickTab("JavaScript"):
model = waitForObject(":JavaScript.QmlProfilerV8ProfileTable_QmlProfiler::"
"Internal::QmlProfilerEventsMainView").model()
test.compare(model.rowCount(), 1) # Could change, see QTCREATORBUG-8994
test.compare([str(model.index(0, column).data()) for column in range(6)],
['<program>', '100.00 %', '0.000 \xc2\xb5s', '0.00 %', '0.000 \xc2\xb5s', 'Main Program'])
if safeClickTab("Events"):
model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QmlProfilerEventsMainView").model()
test.compare(model.rowCount(), 2) # Only two lines with Qt 4.7, more with Qt 4.8
test.compare(dumpItems(model, column=0), ['<program>', 'main.qml:14'])
test.compare(dumpItems(model, column=1), ['Binding', 'Signal'])
test.compare(dumpItems(model, column=2), ['100.00 %', '100.00 %'])
test.compare(dumpItems(model, column=4), ['1', '2'])
test.compare(dumpItems(model, column=9), ['Main Program', 'triggered(): { var i; for (i = 1; i < 2500; ++i) '
'{ var j = i * i; console.log(j); } }'])
for i in [3, 5, 6, 7]:
for item in dumpItems(model, column=i):
test.verify(item.endswith(' ms'))
test.verify(str(model.index(0, 8).data()).endswith(' ms'))
test.xverify(str(model.index(1, 8).data()).endswith(' ms')) # QTCREATORBUG-8996
deleteAppFromWinFW(workingDir, projectName, False)
invokeMenuItem("File", "Exit")
def safeClickTab(tab):
for bar in [":*Qt Creator.JavaScript_QTabBar",
":*Qt Creator.Events_QTabBar"]:
try:
clickTab(waitForObject(bar, 1000), tab)
return True
except:
pass
test.fail("Tab %s is not being shown." % tab)
return False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment