Commit e60d2af0 authored by Robert Loehning's avatar Robert Loehning
Browse files

Squish: Updated iterateBuildConfigs() to handle multiple kits



Change-Id: I724e45bf510015dbdae6cb4c6cb55285167dafbc
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 20d4efb0
......@@ -132,19 +132,22 @@ 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)
# returns a list of pairs each containing the zero based number of a kit
# and the name of the matching build configuration
# param kitCount specifies the number of kits currently defined (must be correct!)
# param filter is a regular expression to filter the configuration by their name
def iterateBuildConfigs(targetCount, currentTarget, filter = ""):
def iterateBuildConfigs(kitCount, filter = ""):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD)
model = waitForObject(":scrollArea.Edit build configuration:_QComboBox", 20000).model()
prog = re.compile(filter)
# for each row in the model, write its data to a list
configNames = dumpItems(model)
# pick only those configuration names which pass the filter
configs = [config for config in configNames if prog.match(config)]
configs = []
for currentKit in range(kitCount):
switchToBuildOrRunSettingsFor(kitCount, currentKit, ProjectSettings.BUILD)
model = waitForObject(":scrollArea.Edit build configuration:_QComboBox", 20000).model()
prog = re.compile(filter)
# for each row in the model, write its data to a list
configNames = dumpItems(model)
# pick only those configuration names which pass the filter
configs += zip([currentKit] * len(configNames),
[config for config in configNames if prog.match(config)])
switchViewTo(ViewConstants.EDIT)
return configs
......
......@@ -15,14 +15,14 @@ def verifyBuildAndRun():
# pick version 4.7.4 and then run project for debug and release
def pickVersion474runVerify():
availableConfigs = iterateBuildConfigs(1, 0)
availableConfigs = iterateBuildConfigs(1)
if not availableConfigs:
test.fatal("Haven't found needed Qt version (Qt 4.7.4), quitting")
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
# select debug configuration
for config in availableConfigs:
selectBuildConfig(1, 0, config)
for kit, config in availableConfigs:
selectBuildConfig(1, kit, config)
test.log("Using build config '%s'" % config)
runAndCloseApp()
verifyBuildAndRun()
......
......@@ -14,12 +14,12 @@ def main():
startApplication("qtcreator" + SettingsPath)
# open example project
openQmakeProject(examplePath)
# build and wait until finished - on all (except Qt 4.7.0 (would fail)) build configurations
availableConfigs = iterateBuildConfigs(1, 0)
# build and wait until finished - on all build configurations
availableConfigs = iterateBuildConfigs(1)
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (anything except Qt 4.7.0) - leaving without building.")
for config in availableConfigs:
selectBuildConfig(1, 0, config)
test.fatal("Haven't found a suitable Qt version - leaving without building.")
for kit, config in availableConfigs:
selectBuildConfig(1, kit, config)
# try to build project
test.log("Testing build configuration: " + config)
invokeMenuItem("Build", "Build All")
......
......@@ -6,12 +6,12 @@ def main():
startApplication("qtcreator" + SettingsPath)
# create qt quick application
createNewQtQuickApplication(tempDir(), "SampleApp")
# build it - on all (except Qt 4.7.0 (would fail)) build configurations
availableConfigs = iterateBuildConfigs(1, 0)
# build it - on all build configurations
availableConfigs = iterateBuildConfigs(1)
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (anything except Qt 4.7.0) - leaving without building.")
for config in availableConfigs:
selectBuildConfig(1, 0, config)
test.fatal("Haven't found a suitable Qt version - leaving without building.")
for kit, config in availableConfigs:
selectBuildConfig(1, kit, config)
# try to compile
test.log("Testing build configuration: " + config)
clickButton(waitForObject(":*Qt Creator.Build Project_Core::Internal::FancyToolButton"))
......
......@@ -16,12 +16,12 @@ def main():
return
# save all
invokeMenuItem("File", "Save All")
# build it - on all (except Qt 4.7.0 (would fail)) build configurations
availableConfigs = iterateBuildConfigs(1, 0)
# build it - on all build configurations
availableConfigs = iterateBuildConfigs(1)
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (anything except Qt 4.7.0) - leaving without building.")
for config in availableConfigs:
selectBuildConfig(1, 0, config)
test.fatal("Haven't found a suitable Qt version - leaving without building.")
for kit, config in availableConfigs:
selectBuildConfig(1, kit, config)
# try to compile
test.log("Testing build configuration: " + config)
clickButton(waitForObject(":*Qt Creator.Build Project_Core::Internal::FancyToolButton"))
......
......@@ -5,11 +5,11 @@ project = "SquishProject"
def main():
startApplication("qtcreator" + SettingsPath)
createProject_Qt_Console(tempDir(), project)
availableConfigs = iterateBuildConfigs(1, 0)
availableConfigs = iterateBuildConfigs(1)
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version - leaving without building.")
for config in availableConfigs:
selectBuildConfig(1, 0, config)
for kit, config in availableConfigs:
selectBuildConfig(1, kit, config)
test.log("Testing build configuration: " + config)
runAndCloseApp()
invokeMenuItem("File", "Exit")
......@@ -36,11 +36,11 @@ def main():
test.verify("CONFIG += console" in str(proEditor.plainText), "Verifying that program is configured with console")
setRunInTerminal(1, 0, False)
availableConfigs = iterateBuildConfigs(1, 0)
availableConfigs = iterateBuildConfigs(1)
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version - leaving without building.")
for config in availableConfigs:
selectBuildConfig(1, 0, config)
for kit, config in availableConfigs:
selectBuildConfig(1, kit, config)
test.log("Testing build configuration: " + config)
test.log("Running application")
......
......@@ -33,13 +33,13 @@ def main():
if result:
expectedBreakpointsOrder = [{"main.cpp":9}, {"main.qml":13}]
# Only use 4.7.4 to work around QTBUG-25187
availableConfigs = iterateBuildConfigs(1, 0, "Debug")
availableConfigs = iterateBuildConfigs(1, "Debug")
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (need Qt 4.7.4) - leaving without debugging.")
for config in availableConfigs:
for kit, config in availableConfigs:
test.log("Selecting '%s' as build config" % config)
selectBuildConfig(1, 0, config)
verifyBuildConfig(1, 0, True, enableQmlDebug=True)
selectBuildConfig(1, kit, config)
verifyBuildConfig(1, kit, 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'}",
......
......@@ -20,11 +20,11 @@ def main():
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
availableConfigs = iterateBuildConfigs(1, 0, "Release")
availableConfigs = iterateBuildConfigs(1, "Release")
if not availableConfigs:
test.fatal("Haven't found a suitable Qt version (need Release build) - leaving without building.")
for config in availableConfigs:
selectBuildConfig(1, 0, config)
for kit, config in availableConfigs:
selectBuildConfig(1, kit, config)
buildConfig = buildConfigFromFancyToolButton(fancyToolButton)
if buildConfig != config:
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
......
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