Commit 73005e6b authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Added functions for switching build configurations



Change-Id: I03eb8987ec28bac7db99395ed91952d8a3a0d038
Reviewed-by: default avatarBill King <bill.king@nokia.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent 82709dc7
......@@ -48,6 +48,8 @@
: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'}
:scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create Build Configurations:' type='QLabel' 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.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'}
......
import re;
# dictionary to hold a list of all installed handler functions for all object-signalSignature pairs
installedSignalHandlers = {}
# flag to indicate whether overrideInstallLazySignalHandler() has been called already
......@@ -134,3 +136,31 @@ def createTasksFile(list):
file.close()
test.log("Written tasks file %s" % outfile)
# returns a list of the build configurations for a target
# param targetCount specifies the number of targets currently defined (must be correct!)
# param currentTarget specifies the target for which to switch into the specified settings (zero based index)
# param filter is a regular expression to filter the configuration by their name
def iterateBuildConfigs(targetCount, currentTarget, filter = ""):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD)
configs = []
model = waitForObject(":scrollArea.Edit build configuration:_QComboBox", 20000).model()
prog = re.compile(filter)
for row in range(model.rowCount()):
configName = str(model.index(row, 0).data())
if prog.match(configName):
configs += [configName]
switchViewTo(ViewConstants.EDIT)
return configs
# selects a build configuration for building the current project
# param targetCount specifies the number of targets currently defined (must be correct!)
# param currentTarget specifies the target for which to switch into the specified settings (zero based index)
# param configName is the name of the configuration that should be selected
def selectBuildConfig(targetCount, currentTarget, configName):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD)
if selectFromCombo(":scrollArea.Edit build configuration:_QComboBox", configName):
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}",
"sourceFilesRefreshed(QStringList)")
switchViewTo(ViewConstants.EDIT)
......@@ -52,12 +52,16 @@ def verifyEnabled(objectSpec, expectedState = True):
# param objectSpec specifies the combo box. It can either be a string determining an object
# or the object itself. If it is an object, it must exist already.
# param itemName is the item to be selected in the combo box
# returns True if selection was changed or False if the wanted value was already selected
def selectFromCombo(objectSpec, itemName):
object = verifyEnabled(objectSpec)
if itemName != str(object.currentText):
if itemName == str(object.currentText):
return False
else:
mouseClick(object, 5, 5, 0, Qt.LeftButton)
mouseClick(waitForObjectItem(object, itemName.replace(".", "\\.")), 5, 5, 0, Qt.LeftButton)
waitFor("str(object.currentText)==itemName", 5000)
return True
def selectFromLocator(filter, itemName = None):
if itemName == None:
......
source("../../shared/qtcreator.py")
import re;
SpeedCrunchPath = ""
......@@ -25,33 +24,20 @@ def main():
test.compare(waitForObject(node).text, value)
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
clickButton(fancyToolButton)
listWidget = waitForObject("{occurrence='2' type='ProjectExplorer::Internal::GenericListWidget' unnamed='1' visible='0' "
"window=':QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector'}")
mouseClick(waitForObject(":QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector"), -5, 5, 0, Qt.LeftButton)
prog = re.compile("(Desktop )?Qt.*Release")
for row in range(listWidget.count):
currentItem = listWidget.item(row)
if prog.match(str(currentItem.text())):
clickButton(fancyToolButton)
itemText = currentItem.text()
test.log("Testing build configuration: "+str(itemText))
if listWidget.currentRow != row:
rect = listWidget.visualItemRect(currentItem)
mouseClick(listWidget, rect.x+5, rect.y+5, 0, Qt.LeftButton)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
mouseClick(waitForObject(":QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector"), -45, 64, 0, Qt.LeftButton)
buildConfig = buildConfigFromFancyToolButtton(fancyToolButton)
if buildConfig != currentItem.text():
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, currentItem.text()))
continue
invokeMenuItem("Build", "Run qmake")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
invokeMenuItem("Build", "Rebuild All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000)
checkCompile()
checkLastBuild()
for config in iterateBuildConfigs(1, 0, "(Desktop )?Qt.*Release"):
selectBuildConfig(1, 0, config)
buildConfig = buildConfigFromFancyToolButtton(fancyToolButton)
if buildConfig != config:
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
continue
test.log("Testing build configuration: " + config)
invokeMenuItem("Build", "Run qmake")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
invokeMenuItem("Build", "Rebuild All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000)
checkCompile()
checkLastBuild()
# Add a new run configuration
......
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