forked from qt-creator/qt-creator
Squish: Added functions for switching build configurations
Change-Id: I03eb8987ec28bac7db99395ed91952d8a3a0d038 Reviewed-by: Bill King <bill.king@nokia.com> Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
This commit is contained in:
committed by
Robert Löhning
parent
82709dc766
commit
73005e6bca
@@ -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:_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 {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.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) 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 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:_QComboBox {aboveWidget=':scrollArea.Use Shadow Building_QCheckBox' container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Qt Version:_QLabel' type='QComboBox' unnamed='1' visible='1'}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import re;
|
||||||
|
|
||||||
# dictionary to hold a list of all installed handler functions for all object-signalSignature pairs
|
# dictionary to hold a list of all installed handler functions for all object-signalSignature pairs
|
||||||
installedSignalHandlers = {}
|
installedSignalHandlers = {}
|
||||||
# flag to indicate whether overrideInstallLazySignalHandler() has been called already
|
# flag to indicate whether overrideInstallLazySignalHandler() has been called already
|
||||||
@@ -134,3 +136,31 @@ def createTasksFile(list):
|
|||||||
file.close()
|
file.close()
|
||||||
test.log("Written tasks file %s" % outfile)
|
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
|
# 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.
|
# 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
|
# 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):
|
def selectFromCombo(objectSpec, itemName):
|
||||||
object = verifyEnabled(objectSpec)
|
object = verifyEnabled(objectSpec)
|
||||||
if itemName != str(object.currentText):
|
if itemName == str(object.currentText):
|
||||||
|
return False
|
||||||
|
else:
|
||||||
mouseClick(object, 5, 5, 0, Qt.LeftButton)
|
mouseClick(object, 5, 5, 0, Qt.LeftButton)
|
||||||
mouseClick(waitForObjectItem(object, itemName.replace(".", "\\.")), 5, 5, 0, Qt.LeftButton)
|
mouseClick(waitForObjectItem(object, itemName.replace(".", "\\.")), 5, 5, 0, Qt.LeftButton)
|
||||||
waitFor("str(object.currentText)==itemName", 5000)
|
waitFor("str(object.currentText)==itemName", 5000)
|
||||||
|
return True
|
||||||
|
|
||||||
def selectFromLocator(filter, itemName = None):
|
def selectFromLocator(filter, itemName = None):
|
||||||
if itemName == None:
|
if itemName == None:
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
source("../../shared/qtcreator.py")
|
source("../../shared/qtcreator.py")
|
||||||
import re;
|
|
||||||
|
|
||||||
SpeedCrunchPath = ""
|
SpeedCrunchPath = ""
|
||||||
|
|
||||||
@@ -25,33 +24,20 @@ def main():
|
|||||||
test.compare(waitForObject(node).text, value)
|
test.compare(waitForObject(node).text, value)
|
||||||
|
|
||||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
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 config in iterateBuildConfigs(1, 0, "(Desktop )?Qt.*Release"):
|
||||||
for row in range(listWidget.count):
|
selectBuildConfig(1, 0, config)
|
||||||
currentItem = listWidget.item(row)
|
buildConfig = buildConfigFromFancyToolButtton(fancyToolButton)
|
||||||
if prog.match(str(currentItem.text())):
|
if buildConfig != config:
|
||||||
clickButton(fancyToolButton)
|
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
|
||||||
itemText = currentItem.text()
|
continue
|
||||||
test.log("Testing build configuration: "+str(itemText))
|
test.log("Testing build configuration: " + config)
|
||||||
if listWidget.currentRow != row:
|
invokeMenuItem("Build", "Run qmake")
|
||||||
rect = listWidget.visualItemRect(currentItem)
|
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
|
||||||
mouseClick(listWidget, rect.x+5, rect.y+5, 0, Qt.LeftButton)
|
invokeMenuItem("Build", "Rebuild All")
|
||||||
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
|
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000)
|
||||||
mouseClick(waitForObject(":QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector"), -45, 64, 0, Qt.LeftButton)
|
checkCompile()
|
||||||
buildConfig = buildConfigFromFancyToolButtton(fancyToolButton)
|
checkLastBuild()
|
||||||
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()
|
|
||||||
|
|
||||||
# Add a new run configuration
|
# Add a new run configuration
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user