Squish: Fix tst_debug_empty_main

Change-Id: I5c484a46cf795feee17c200416c4cd303c189774
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2020-01-27 13:04:11 +01:00
parent db01563fda
commit 0168a42b72
3 changed files with 18 additions and 15 deletions

View File

@@ -127,6 +127,8 @@
:Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'} :Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'}
:Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu'} :Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu'}
:Qt Creator.Project.Menu.Folder_QMenu {name='Project.Menu.Folder' type='QMenu' visible='1'} :Qt Creator.Project.Menu.Folder_QMenu {name='Project.Menu.Folder' type='QMenu' visible='1'}
:Qt Creator.QML debugging and profiling:_QComboBox {leftWidget=':Qt Creator.QML debugging and profiling:_QLabel' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.QML debugging and profiling:_QLabel {text='QML debugging and profiling:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -216,7 +218,6 @@
:scrollArea.Edit build configuration:_QComboBox {leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'} :scrollArea.Edit build configuration:_QComboBox {leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Edit build configuration:_QLabel {text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'} :scrollArea.Edit build configuration:_QLabel {text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'}
:scrollArea.Library not available_QLabel {name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :scrollArea.Library not available_QLabel {name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {name='SrcFileName' type='Utils::FancyLineEdit' visible='1' window=':New_ProjectExplorer::JsonWizard'} :sourceFileLineEdit_Utils::FileNameValidatingLineEdit {name='SrcFileName' type='Utils::FancyLineEdit' visible='1' window=':New_ProjectExplorer::JsonWizard'}
:splitter.Commit File(s)_VcsBase::QActionPushButton {text~='(Commit .+/.+ File.*)' type='VcsBase::QActionPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :splitter.Commit File(s)_VcsBase::QActionPushButton {text~='(Commit .+/.+ File.*)' type='VcsBase::QActionPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:splitter.Description_QGroupBox {container=':Qt Creator.splitter_QSplitter' name='descriptionBox' title='Description' type='QGroupBox' visible='1'} :splitter.Description_QGroupBox {container=':Qt Creator.splitter_QSplitter' name='descriptionBox' title='Description' type='QGroupBox' visible='1'}

View File

@@ -170,8 +170,8 @@ def verifyBuildConfig(currentTarget, configName, shouldBeDebug=False, enableShad
"window=':Qt Creator_Core::Internal::MainWindow'} " "window=':Qt Creator_Core::Internal::MainWindow'} "
"type='QCheckBox' unnamed='1' visible='1' " "type='QCheckBox' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}", enableShadowBuild) "window=':Qt Creator_Core::Internal::MainWindow'}", enableShadowBuild)
buildCfCombo = waitForObject("{type='QComboBox' name='buildConfigurationComboBox' visible='1' " buildCfCombo = waitForObject("{leftWidget=':scrollArea.Edit build configuration:_QLabel' "
"window=':Qt Creator_Core::Internal::MainWindow'}") "type='QComboBox' unnamed='1' visible='1'}")
if shouldBeDebug: if shouldBeDebug:
test.compare(buildCfCombo.currentText, 'Debug', "Verifying whether it's a debug build") test.compare(buildCfCombo.currentText, 'Debug', "Verifying whether it's a debug build")
else: else:
@@ -184,9 +184,9 @@ def verifyBuildConfig(currentTarget, configName, shouldBeDebug=False, enableShad
pass pass
# Since waitForObject waits for the object to be enabled, # Since waitForObject waits for the object to be enabled,
# it will wait here until compilation of the debug libraries has finished. # it will wait here until compilation of the debug libraries has finished.
qmlDebugCheckbox = waitForObject(":scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox", 150000) if currentTarget not in (Targets.DESKTOP_4_8_7_DEFAULT, Targets.EMBEDDED_LINUX):
if qmlDebugCheckbox.checked != enableQmlDebug: qmlDebuggingCombo = findObject(':Qt Creator.QML debugging and profiling:_QComboBox')
clickButton(qmlDebugCheckbox) selectFromCombo(qmlDebuggingCombo, 'Enable')
# Don't rebuild now # Don't rebuild now
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000)) clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
try: try:
@@ -197,10 +197,10 @@ def verifyBuildConfig(currentTarget, configName, shouldBeDebug=False, enableShad
except: except:
pass pass
else: else:
qmlDebugCheckbox = findObject(":scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox") if currentTarget not in (Targets.DESKTOP_4_8_7_DEFAULT, Targets.EMBEDDED_LINUX):
if qmlDebugCheckbox.enabled and qmlDebugCheckbox.checked: qmlDebuggingCombo = findObject(':Qt Creator.QML debugging and profiling:_QComboBox')
test.log("Qml debugging libraries are available - unchecking qml debugging.") if selectFromCombo(qmlDebuggingCombo, "Disable"):
clickButton(qmlDebugCheckbox) test.log("Qml debugging libraries are available - unchecked qml debugging.")
# Don't rebuild now # Don't rebuild now
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000)) clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
clickButton(waitForObject(":scrollArea.Details_Utils::DetailsButton")) clickButton(waitForObject(":scrollArea.Details_Utils::DetailsButton"))

View File

@@ -36,7 +36,7 @@ def addFileToProject(projectPath, category, fileTemplate, fileName):
projectPath, "Verifying whether path is correct."): projectPath, "Verifying whether path is correct."):
replaceEditorContent(pathLineEdit, projectPath) replaceEditorContent(pathLineEdit, projectPath)
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
projCombo = waitForObject("{buddy={name='projectLabel' text='Add to project:' type='QLabel' " projCombo = findObject("{buddy={name='projectLabel' text='Add to project:' type='QLabel' "
"visible='1'} name='projectComboBox' type='QComboBox' visible='1'}") "visible='1'} name='projectComboBox' type='QComboBox' visible='1'}")
proFileName = os.path.basename(projectPath) + ".pro" proFileName = os.path.basename(projectPath) + ".pro"
test.verify(not selectFromCombo(projCombo, proFileName), "Verifying project is selected.") test.verify(not selectFromCombo(projCombo, proFileName), "Verifying project is selected.")
@@ -51,6 +51,7 @@ def main():
# empty Qt # empty Qt
workingDir = tempDir() workingDir = tempDir()
projectName = createEmptyQtProject(workingDir, "EmptyQtProj", targets) projectName = createEmptyQtProject(workingDir, "EmptyQtProj", targets)
waitForProjectParsing()
addFileToProject(os.path.join(workingDir, projectName), " C++", "C++ Source File", "main.cpp") addFileToProject(os.path.join(workingDir, projectName), " C++", "C++ Source File", "main.cpp")
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
typeLines(editor, ["int main() {"]) typeLines(editor, ["int main() {"])
@@ -65,6 +66,7 @@ def main():
qtVersion = qtVersion.replace(".", "") qtVersion = qtVersion.replace(".", "")
projectName = createNewNonQtProject(workingDir, "Sample%s%s" % (name, qtVersion), projectName = createNewNonQtProject(workingDir, "Sample%s%s" % (name, qtVersion),
[singleTarget], isC) [singleTarget], isC)
waitForProjectParsing()
if projectName == None: if projectName == None:
test.fail("Failed to create Sample%s%s" % (name, qtVersion), test.fail("Failed to create Sample%s%s" % (name, qtVersion),
"Target: %s, plainC: %s" % (Targets.getStringForTargt(singleTarget), isC)) "Target: %s, plainC: %s" % (Targets.getStringForTargt(singleTarget), isC))
@@ -94,7 +96,7 @@ def performDebugging(projectName):
test.log("Selecting '%s' as build config" % config) test.log("Selecting '%s' as build config" % config)
verifyBuildConfig(kit, config, True, True) verifyBuildConfig(kit, config, True, True)
waitForObject(":*Qt Creator.Build Project_Core::Internal::FancyToolButton") waitForObject(":*Qt Creator.Build Project_Core::Internal::FancyToolButton")
invokeMenuItem("Build", "Rebuild All") invokeMenuItem("Build", "Rebuild All Projects")
waitForCompile() waitForCompile()
isMsvc = isMsvcConfig(kit) isMsvc = isMsvcConfig(kit)
clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton")) clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))