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

Squish: Fix tst_simple_analyze



Change-Id: Iac334d37a1cf6a85d4f85d09165503f9bca8ce91
Reviewed-by: default avatarRobert Loehning <robert.loehning@theqtcompany.com>
parent 6a7df3ee
......@@ -104,7 +104,6 @@
:Help Widget_Help::Internal::HelpWidget {type='Help::Internal::HelpWidget' unnamed='1' visible='1' windowTitle?='Help -*'}
:Hits_QCLuceneResultWidget {aboveWidget=':Hits_QLabel' type='QCLuceneResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:JavaScript.QmlProfilerEventsTable_QmlProfiler::Internal::QV8ProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QV8ProfilerEventsMainView' visible='1'}
:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':QtVersionLabel_KitPage' 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'}
:Minimal required Qt version:_QLabel {text='Minimal required Qt version:' type='QLabel' unnamed='1' visible='1' window=':New Text File_ProjectExplorer::JsonWizard'}
......
......@@ -36,10 +36,10 @@ def main():
return
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
# we need a Qt >= 4.8
analyzerTargets = Targets.desktopTargetClasses() & ~Targets.DESKTOP_474_GCC
# we need a Qt >= 5.3 - we use checkedTargets, so we should get only valid targets
analyzerTargets = Targets.desktopTargetClasses()
if platform.system() in ('Windows', 'Microsoft') and JIRA.isBugStillOpen(14307):
analyzerTargets &= ~Targets.DESKTOP_480_DEFAULT & ~Targets.DESKTOP_541_GCC
analyzerTargets &= ~Targets.DESKTOP_541_GCC
checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=analyzerTargets)
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
if placeCursorToLine(editor, "MouseArea.*", True):
......@@ -59,13 +59,12 @@ def main():
invokeMenuItem("File", "Save All")
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (need Qt 4.8) - leaving without debugging.")
test.fatal("Haven't found a suitable Qt version (need Qt 5.3+) - leaving without debugging.")
else:
performTest(workingDir, projectName, len(checkedTargets), availableConfigs, False)
performTest(workingDir, projectName, len(checkedTargets), availableConfigs, True)
performTest(workingDir, projectName, len(checkedTargets), availableConfigs)
invokeMenuItem("File", "Exit")
def performTest(workingDir, projectName, targetCount, availableConfigs, disableOptimizer):
def performTest(workingDir, projectName, targetCount, availableConfigs):
def __elapsedTime__(elapsedTimeLabelText):
return float(re.search("Elapsed:\s+(-?\d+\.\d+) s", elapsedTimeLabelText).group(1))
......@@ -75,9 +74,6 @@ def performTest(workingDir, projectName, targetCount, availableConfigs, disableO
invokeMenuItem('Build', 'Clean Project "%s"' % projectName)
qtVersion = verifyBuildConfig(targetCount, kit, config, True, enableQmlDebug=True)[0]
test.log("Selected kit using Qt %s" % qtVersion)
if disableOptimizer:
batchEditRunEnvironment(targetCount, kit, ["QML_DISABLE_OPTIMIZER=1"])
switchViewTo(ViewConstants.EDIT)
# explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All")
waitForCompile()
......@@ -106,30 +102,18 @@ def performTest(workingDir, projectName, targetCount, availableConfigs, disableO
"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("V8"):
model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QV8ProfilerEventsMainView").model()
test.compare(model.rowCount(), 0)
if safeClickTab("Events"):
colPercent, colTotal, colCalls, colMean, colMedian, colLongest, colShortest = range(2, 9)
model = waitForObject(":Events.QmlProfilerEventsTable_QmlProfiler::"
"Internal::QmlProfilerEventsMainView").model()
if qtVersion.startswith("5."):
if disableOptimizer:
compareEventsTab(model, "events_qt50_nonOptimized.tsv")
else:
compareEventsTab(model, "events_qt50.tsv")
numberOfMsRows = 3
else:
if disableOptimizer:
compareEventsTab(model, "events_qt48_nonOptimized.tsv")
else:
compareEventsTab(model, "events_qt48.tsv")
numberOfMsRows = 2
compareEventsTab(model, "events_qt5.tsv")
numberOfMsRows = 3
test.compare(dumpItems(model, column=colPercent)[0], '100.00 %')
for i in [colTotal, colMean, colMedian, colLongest, colShortest]:
# cannot run following test on colShortest (unstable)
for i in [colTotal, colMean, colMedian, colLongest]:
for item in dumpItems(model, column=i)[:numberOfMsRows]:
test.verify(item.endswith(' ms'), "Verify that '%s' ends with ' ms'" % item)
for i in [colTotal, colMean, colMedian, colLongest, colShortest]:
for item in dumpItems(model, column=i):
test.verify(not item.startswith('0.000 '),
"Check for implausible durations (QTCREATORBUG-8996): %s" % item)
......
"0" "1" "4" "9"
"<program>" "" "1" "Main Program"
"main.qml:12" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Create" "1" "main.qml"
"main.qml:1" "Compile" "1" "main.qml"
"main.qml:31" "Binding" "1" "text: qsTr(""Hello World"")"
"<bytecode>" "Binding" "2" "Source code not available"
"main.qml:11" "Binding" "3" "running: runCount < 2"
"0" "1" "4" "9"
"<program>" "" "1" "Main Program"
"main.qml:12" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Create" "1" "main.qml"
"main.qml:1" "Compile" "1" "main.qml"
"main.qml:31" "Binding" "1" "text: qsTr(""Hello World"")"
"main.qml:11" "Binding" "3" "running: runCount < 2"
"main.qml:32" "Binding" "1" "centerIn: parent"
"main.qml:24" "Binding" "1" "fill: parent"
"0" "1" "4" "9"
"<program>" "" "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); } }"
"main.qml:12" "JavaScript" "2" "onTriggered"
"main.qml:30" "Create" "2" "QtQuick/Text"
"main.qml:1" "Compile" "1" "main.qml"
"main.qml:7" "Create" "2" "QtQuick/Timer"
"main.qml:32" "Binding" "1" "anchors.centerIn: parent"
"main.qml:23" "Create" "2" "QtQuick/MouseArea"
"main.qml:11" "Binding" "3" "running: runCount < 2"
"main.qml:32" "JavaScript" "1" "expression for centerIn"
"main.qml:24" "Binding" "1" "anchors.fill: parent"
"main.qml:11" "JavaScript" "3" "expression for running"
"main.qml:24" "JavaScript" "1" "expression for fill"
"0" "1" "4" "9"
"<program>" "" "1" "Main Program"
"main.qml:1" "Create" "1" "main.qml"
"main.qml:12" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Compile" "1" "main.qml"
"main.qml:31" "Binding" "1" "text: qsTr(""Hello World"")"
"<bytecode>" "Binding" "2" "Source code not available"
"main.qml:11" "Binding" "3" "running: runCount < 2"
"0" "1" "4" "9"
"<program>" "" "1" "Main Program"
"main.qml:1" "Create" "1" "main.qml"
"main.qml:12" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Compile" "1" "main.qml"
"main.qml:31" "Binding" "1" "text: qsTr(""Hello World"")"
"main.qml:11" "Binding" "3" "running: runCount < 2"
"main.qml:32" "Binding" "1" "centerIn: parent"
"main.qml:24" "Binding" "1" "fill: parent"
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