Commit 49a3f012 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Run tst_simple_debug with Qt 4.7



Change-Id: Ibc330a7ca3e1c378c78cf8eb4c559c2a99c3d8d0
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent 7b51bfc8
......@@ -32,6 +32,8 @@
:Options.qt_tabwidget_tabbar_QTabBar {name='qt_tabwidget_tabbar' type='QTabBar' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Options_Core::Internal::SettingsDialog {type='Core::Internal::SettingsDialog' unnamed='1' visible='1' windowTitle~='(Options|Preferences)'}
:Options_QListView {type='QListView' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:QML Debugging.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':QML Debugging_QMessageBox'}
:QML Debugging_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='QML Debugging'}
:Qt Creator.Create Build Configurations:_QComboBox {leftWidget=':Qt Creator.Create Build Configurations:_QLabel' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Create Build Configurations:_QLabel {text='Create build configurations:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.DebugModeWidget_QSplitter {name='DebugModeWidget' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
......@@ -69,11 +71,13 @@
:scrollArea.Details_Utils::DetailsButton {container=':Qt Creator.scrollArea_QScrollArea' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1'}
:scrollArea.Edit build configuration:_QComboBox {container=':Qt Creator.scrollArea_QScrollArea' leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Edit build configuration:_QLabel {container=':Qt Creator.scrollArea_QScrollArea' text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'}
:scrollArea.Library not available_QLabel {container=':Qt Creator.scrollArea_QScrollArea' name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1'}
:scrollArea.Qt 4 for Desktop - (Qt SDK) debug_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text?='*Qt 4.* for *(Qt SDK) debug' type='QCheckBox' unnamed='1' visible='1'}
:scrollArea.Qt 4 for Desktop - (Qt SDK) release_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text?='*Qt 4.* for *(Qt SDK) release' type='QCheckBox' unnamed='1' visible='1'}
:scrollArea.Qt Version:_QComboBox {aboveWidget=':scrollArea.Use Shadow Building_QCheckBox' container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Qt Version:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Qt Version:_QLabel {container=':Qt Gui Application.scrollArea_QScrollArea' text='Qt Version:' type='QLabel' unnamed='1' visible='1'}
:scrollArea.Use Shadow Building_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text='Shadow build' type='QCheckBox' unnamed='1' visible='1'}
:scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1'}
:scrollArea.qtVersionComboBox_QComboBox {container=':Qt Creator.scrollArea_QScrollArea' name='qtVersionComboBox' type='QComboBox' visible='1'}
:scrollArea_QTableView {container=':Qt Creator.scrollArea_QScrollArea' type='QTableView' unnamed='1' visible='1'}
:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
......@@ -164,7 +164,8 @@ def selectBuildConfig(targetCount, currentTarget, configName):
"sourceFilesRefreshed(QStringList)")
switchViewTo(ViewConstants.EDIT)
def verifyBuildConfig(targetCount, currentTarget, shouldBeDebug=False, enableShadowBuild=False):
# This will not trigger a rebuild. If needed, caller has to do this.
def verifyBuildConfig(targetCount, currentTarget, shouldBeDebug=False, enableShadowBuild=False, enableQmlDebug=False):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD)
detailsButton = waitForObject(":scrollArea.Details_Utils::DetailsButton")
......@@ -176,6 +177,18 @@ def verifyBuildConfig(targetCount, currentTarget, shouldBeDebug=False, enableSha
test.compare(buildCfCombo.currentText, 'Debug', "Verifying whether it's a debug build")
else:
test.compare(buildCfCombo.currentText, 'Release', "Verifying whether it's a release build")
try:
libLabel = waitForObject(":scrollArea.Library not available_QLabel", 2000)
mouseClick(libLabel, libLabel.width - 5, 5, 0, Qt.LeftButton)
except:
pass
# Since waitForObject waits for the object to be enabled,
# it will wait here until compilation of the debug libraries has finished.
qmlDebugCheckbox = waitForObject(":scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox", 150000)
if qmlDebugCheckbox.checked != enableQmlDebug:
clickButton(qmlDebugCheckbox)
# Don't rebuild now
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
try:
problemFound = waitForObject("{container=':Qt Creator.scrollArea_QScrollArea' type='QLabel' "
"name='problemLabel' visible='1'}", 1000)
......
......@@ -5,7 +5,7 @@ workingDir = None
def main():
global workingDir
startApplication("qtcreator" + SettingsPath)
if not checkDebuggingLibrary("4.8.0", [QtQuickConstants.Targets.DESKTOP]):
if not checkDebuggingLibrary("4.7.4", [QtQuickConstants.Targets.DESKTOP]):
test.fatal("Error while checking debugging libraries - leaving this test.")
invokeMenuItem("File", "Exit")
return
......@@ -20,23 +20,27 @@ def main():
if placeCursorToLine(editor, "MouseArea.*", True):
type(editor, '<Up>')
type(editor, '<Return>')
type(editor, 'Component.onCompleted: console.log("Break here")')
typeLines(editor, ['Timer {',
'interval: 1000',
'running: true',
'onTriggered: console.log("Break here")'])
invokeMenuItem("File", "Save All")
filesAndLines = {
"%s.QML.qml/%s.main\\.qml" % (projectName,projectName) : 'Component.onCompleted.*',
"%s.QML.qml/%s.main\\.qml" % (projectName,projectName) : 'onTriggered:.*',
"%s.Sources.main\\.cpp" % projectName : "viewer.setOrientation\\(.+\\);"
}
test.log("Setting breakpoints")
result = setBreakpointsForCurrentProject(filesAndLines)
if result:
expectedBreakpointsOrder = [{"main.cpp":9}, {"main.qml":11}]
availableConfigs = iterateBuildConfigs(1, 0, ".*4\.8(\.\d+)?.*$(?<![Rr]elease)")
expectedBreakpointsOrder = [{"main.cpp":9}, {"main.qml":14}]
# Only use 4.7.4 to work around QTBUG-25187
availableConfigs = iterateBuildConfigs(1, 0, ".*4\.7\.4.*$(?<![Rr]elease)")
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 4.7.4) - leaving without debugging.")
for config in availableConfigs:
test.log("Selecting '%s' as build config" % config)
selectBuildConfig(1, 0, config)
verifyBuildConfig(1, 0, True)
verifyBuildConfig(1, 0, 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'}",
......
Supports Markdown
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