Commit 61714ec4 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Added test suite for debugger related tests

Change-Id: I11c114787cc3c2721147d55c86f87aaf31daec9e
Reviewed-on: http://codereview.qt-project.org/5644

Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
parent 81ceeeff
......@@ -14,18 +14,45 @@
:CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard {type='CMakeProjectManager::Internal::CMakeOpenProjectWizard' unnamed='1' visible='1' windowTitle='CMake Wizard'}
:Desktop_QLabel {container=':QtCreator.MenuBar_ProjectExplorer::Internal::ProjectListWidget' name='target' text='Desktop' type='QLabel' visible='1'}
:Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:New.Choose..._QPushButton {text='Choose...' type='QPushButton' unnamed='1' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templatesView_QListView {name='templatesView' type='QListView' visible='1' window=':New_Core::Internal::NewDialog'}
:New_Core::Internal::NewDialog {name='Core__Internal__NewDialog' type='Core::Internal::NewDialog' visible='1' windowTitle='New'}
:Project Setup.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Project Setup_Qt4ProjectManager::Internal::ProjectLoadWizard'}
:Project Setup_Qt4ProjectManager::Internal::ProjectLoadWizard {type='Qt4ProjectManager::Internal::ProjectLoadWizard' unnamed='1' visible='1' windowTitle='Project Setup'}
:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'}
:Qt Creator_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_QToolButton {occurrence='13' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::IconButton {occurrence='2' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Gui Application.Finish_QPushButton {text='Finish' type='QPushButton' unnamed='1' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Next_QPushButton {name='__qt__passive_wizardbutton1' text?='Next*' type='QPushButton' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.frame_QFrame {name='frame' type='QFrame' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog {type='Qt4ProjectManager::Internal::GuiAppWizardDialog' unnamed='1' visible='1' windowTitle='Qt Gui Application'}
:QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector {type='ProjectExplorer::Internal::MiniProjectTargetSelector'}
:QtCreator.MenuBar_ProjectExplorer::Internal::ProjectListWidget {type='ProjectExplorer::Internal::ProjectListWidget' window=':QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector'}
:formFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Form file:_QLabel' name='formFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:frame.nameLineEdit_Utils::ProjectNameValidatingLineEdit {container=':Qt Gui Application.frame_QFrame' name='nameLineEdit' type='Utils::ProjectNameValidatingLineEdit' visible='1'}
:frame_Utils::BaseValidatingLineEdit {container=':Qt Gui Application.frame_QFrame' type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}
:headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:projects.projects.pro_QModelIndex {column='0' container=':projects_QModelIndex' text='projects.pro' type='QModelIndex'}
:projects_QModelIndex {column='0' container=':Qt Creator_Utils::NavigationTreeView' text='projects' type='QModelIndex'}
:scrollArea.Create Build Configurations:_QComboBox {container=':Project Setup.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Create Build Configurations:_QComboBox_2 {container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel_2' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Create Build Configurations:_QLabel {container=':Project Setup.scrollArea_QScrollArea' text='Create Build Configurations:' type='QLabel' unnamed='1' visible='1'}
:Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create Build Configurations:' type='QLabel' unnamed='1' visible='1'}
:scrollArea.Desktop_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text='Desktop' type='QCheckBox' unnamed='1' visible='1'}
:scrollArea.Files to be added {container=':Qt Gui Application.scrollArea_QScrollArea' name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>' 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='Use Shadow Building' type='QCheckBox' unnamed='1' visible='1'}
:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
def shadowBuildDir(path, project, qtVersion, debugVersion):
qtVersion = qtVersion.replace(" ", "_")
qtVersion = qtVersion.replace(".", "_")
qtVersion = qtVersion.replace("(", "_")
qtVersion = qtVersion.replace(")", "_")
buildDir = path + os.sep + project + "-build-desktop-" + qtVersion
if debugVersion:
return buildDir + "_Debug"
else:
return buildDir + "_Release"
def createProject_Qt_GUI(path, projectName, qtVersion, checks):
invokeMenuItem("File", "New File or Project...")
waitForObjectItem(":New.templateCategoryView_QTreeView", "Projects.Qt Widget Project")
clickItem(":New.templateCategoryView_QTreeView", "Projects.Qt Widget Project", 125, 16, 0, Qt.LeftButton)
waitForObjectItem(":New.templatesView_QListView", "Qt Gui Application")
clickItem(":New.templatesView_QListView", "Qt Gui Application", 35, 12, 0, Qt.LeftButton)
clickButton(waitForObject(":New.Choose..._QPushButton"))
directoryEdit = waitForObject(":frame_Utils::BaseValidatingLineEdit")
replaceEditorContent(directoryEdit, path)
projectNameEdit = waitForObject(":frame.nameLineEdit_Utils::ProjectNameValidatingLineEdit")
replaceEditorContent(projectNameEdit, projectName)
clickButton(waitForObject(":Qt Gui Application.Next_QPushButton"))
desktopCheckbox = waitForObject(":scrollArea.Desktop_QCheckBox", 20000)
if checks:
test.compare(desktopCheckbox.text, "Desktop")
if not desktopCheckbox.checked:
clickButton(desktopCheckbox)
selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox_2", "For One Qt Version One Debug And One Release")
selectFromCombo(":scrollArea.Qt Version:_QComboBox", qtVersion.replace(".", "\\."))
if checks:
if platform.system() in ('Windows', 'Microsoft'):
path = os.path.abspath(path)
verifyChecked(":scrollArea.Qt 4 for Desktop - (Qt SDK) debug_QCheckBox")
verifyChecked(":scrollArea.Qt 4 for Desktop - (Qt SDK) release_QCheckBox")
clickButton(waitForObject(":Qt Gui Application.Next_QPushButton"))
if checks:
exp_filename = "mainwindow"
h_file = exp_filename + ".h"
cpp_file = exp_filename + ".cpp"
ui_file = exp_filename + ".ui"
pro_file = projectName + ".pro"
waitFor("object.exists(':headerFileLineEdit_Utils::FileNameValidatingLineEdit')", 20000)
waitFor("object.exists(':sourceFileLineEdit_Utils::FileNameValidatingLineEdit')", 20000)
waitFor("object.exists(':formFileLineEdit_Utils::FileNameValidatingLineEdit')", 20000)
test.compare(findObject(":headerFileLineEdit_Utils::FileNameValidatingLineEdit").text, h_file)
test.compare(findObject(":sourceFileLineEdit_Utils::FileNameValidatingLineEdit").text, cpp_file)
test.compare(findObject(":formFileLineEdit_Utils::FileNameValidatingLineEdit").text, ui_file)
clickButton(verifyEnabled(":Qt Gui Application.Next_QPushButton"))
if checks:
summary = str(waitForObject(":scrollArea.Files to be added").text)
path_found = summary.find(os.path.join(path, projectName))
cpp_found = summary.find(cpp_file)
h_found = summary.find(h_file)
ui_found = summary.find(ui_file)
pro_found = summary.find(pro_file)
test.verify(path_found > 0, "'" + path + "' found at index " + str(path_found))
test.verify(cpp_found > path_found, "'" + cpp_file + "' found at index " + str(cpp_found))
test.verify(h_found > cpp_found, "'" + h_file + "' found at index " + str(h_found))
test.verify(ui_found > cpp_found, "'" + ui_file + "' found at index " + str(ui_found))
test.verify(pro_found > ui_found, "'" + pro_file + "' found at index " + str(pro_found))
clickButton(waitForObject(":Qt Gui Application.Finish_QPushButton"))
if checks:
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
path = os.path.join(path, projectName)
cpp_path = os.path.join(path, cpp_file)
h_path = os.path.join(path, h_file)
ui_path = os.path.join(path, ui_file)
pro_path = os.path.join(path, pro_file)
test.verify(os.path.exists(cpp_path), "Checking if '" + cpp_path + "' was created")
test.verify(os.path.exists(h_path), "Checking if '" + h_path + "' was created")
test.verify(os.path.exists(ui_path), "Checking if '" + ui_path + "' was created")
test.verify(os.path.exists(pro_path), "Checking if '" + pro_path + "' was created")
......@@ -16,6 +16,7 @@ testSettings.logScreenshotOnFail = True
source("../../shared/utils.py")
source("../../shared/build_utils.py")
source("../../shared/mainwin.py")
source("../../shared/project.py")
source("../../shared/qtquick.py")
source("../../shared/editor_utils.py")
......
......@@ -20,9 +20,10 @@ def verifyChecked(objectName):
test.compare(object.checked, True)
return object
def verifyEnabled(objectName):
object = waitForObject(objectName, 20000)
test.compare(object.enabled, True)
def verifyEnabled(objectName, expectedState = True):
waitFor("object.exists('" + objectName + "')", 20000)
object = findObject(objectName)
test.compare(object.enabled, expectedState)
return object
def selectFromCombo(objectName, itemName):
......
AUT=qtcreator
CLASS=
CLASSPATH=
CWD=
ENVVARS=envvars
HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_build_new_project
VERSION=2
WRAPPERS=Qt
source("../../shared/qtcreator.py")
projectsPath = tempDir()
project = "SquishProject"
def main():
startApplication("qtcreator" + SettingsPath)
createProject_Qt_GUI(projectsPath, project, defaultQtVersion, 1)
clickButton(verifyEnabled(":*Qt Creator.Run_Core::Internal::FancyToolButton"))
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
playButton = verifyEnabled(":Qt Creator_QToolButton", False)
stopButton = verifyEnabled(":Qt Creator.Stop_QToolButton")
clickButton(stopButton)
test.verify(playButton.enabled)
test.compare(stopButton.enabled, False)
sendEvent("QCloseEvent", waitForObject(":Qt Creator_Core::Internal::MainWindow"))
waitForCleanShutdown()
def init():
cleanup()
def cleanup():
deleteDirIfExists(projectsPath + os.sep + project)
deleteDirIfExists(shadowBuildDir(projectsPath, project, defaultQtVersion, 1))
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