From ed1f8b9d1fddedb84ed2631e28f5e3a642de3bc6 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 24 Feb 2016 15:03:01 +0100 Subject: [PATCH] Squish: Update tst_simple_analyze Change-Id: Ifba9af5446fec3daa42aa9794a26d02e23b8459d Reviewed-by: Christian Stenger --- tests/system/objects.map | 4 ++-- .../system/suite_debugger/tst_simple_analyze/test.py | 12 +++++++++--- .../tst_simple_analyze/testdata/events_qt5.tsv | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index a10ac7417b..5eb135467b 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -5,7 +5,7 @@ :*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_QDockWidget {name='QmlProfilerStatisticsViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*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='Core__Internal__FindWidget' type='Core::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'} :*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack {name='FormEditorStack' type='Designer::Internal::FormEditorStack' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -76,7 +76,7 @@ :Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'} :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'} +:Events.QmlProfilerEventsTable_QmlProfiler::Internal::QmlProfilerEventsMainView {container=':*Qt Creator.Events_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QmlProfilerStatisticsMainView' visible='1'} :Executable:_Utils::PathChooser {buddy=':scrollArea.Executable:_QLabel' type='Utils::PathChooser' unnamed='1' 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'} diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index bf4dee33ba..57e5671d71 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -95,8 +95,9 @@ def performTest(workingDir, projectName, targetCount, availableConfigs): "Elapsed time should be positive in string '%s'" % str(elapsedLabel.text)) except: test.fatal("Could not read elapsed time from '%s'" % str(elapsedLabel.text)) - if safeClickTab("Events"): - colPercent, colTotal, colCalls, colMean, colMedian, colLongest, colShortest = range(2, 9) + if safeClickTab("Statistics"): + (colPercent, colTotal, colSelfPercent, colSelf, colCalls, + colMean, colMedian, colLongest, colShortest) = range(2, 11) model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::" "Internal::QmlProfilerEventsMainView").model() compareEventsTab(model, "events_qt5.tsv") @@ -111,6 +112,11 @@ def performTest(workingDir, projectName, targetCount, availableConfigs): test.verify(not item.startswith('0.000 '), "Check for implausible durations (QTCREATORBUG-8996): %s" % item) for row in range(model.rowCount()): + selfPercent = str(model.index(row, colSelfPercent).data()) + totalPercent = str(model.index(row, colPercent).data()) + test.verify(float(selfPercent[:-2]) <= float(totalPercent[:-2]), + "Self percentage (%s) can't be more than total percentage (%s)" + % (selfPercent, totalPercent)) if str(model.index(row, colCalls).data()) == "1": for col in [colMedian, colLongest, colShortest]: test.compare(model.index(row, colMean).data(), model.index(row, col).data(), @@ -124,7 +130,7 @@ def performTest(workingDir, projectName, targetCount, availableConfigs): test.verify(waitFor("model.rowCount() == 0", 3000), "Analyzer results cleared.") def compareEventsTab(model, file): - significantColumns = [0, 1, 4, 9] + significantColumns = [0, 1, 6, 11] expectedTable = [] for record in testData.dataset(file): diff --git a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv index 8b8833faeb..3cc221462a 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv +++ b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv @@ -1,4 +1,4 @@ -"0" "1" "4" "9" +"0" "1" "6" "11" "" "" "1" "Main Program" "main.qml:4" "Create" "2" "QtQuick.Window/Window" "main.qml:12" "Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" -- GitLab