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

Squish: Fix hooking for multiple kits



Change-Id: I5389d6aadd39f6c7f7ca6a74e006b110373eee28
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent ada9d162
......@@ -4,19 +4,19 @@ fireWallState = None
# this function modifies all necessary run settings to make it possible to hook into
# the application compiled by Creator
def modifyRunSettingsForHookInto(projectName, port):
prepareBuildSettings(1, 0)
def modifyRunSettingsForHookInto(projectName, kitCount, port):
prepareBuildSettings(kitCount, 0)
# this uses the defaultQtVersion currently
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.BUILD)
qtVersion, mkspec, qtBinPath, qtLibPath = getQtInformationForBuildSettings(True)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.BUILD)
qtVersion, mkspec, qtBinPath, qtLibPath = getQtInformationForBuildSettings(kitCount, True)
if None in (qtVersion, mkspec, qtBinPath, qtLibPath):
test.fatal("At least one of the Qt information returned None - leaving...",
"Qt version: %s, mkspec: %s, Qt BinPath: %s, Qt LibPath: %s" %
(qtVersion, mkspec, qtBinPath, qtLibPath))
return False
qtVersion = ".".join(qtVersion.split(".")[:2])
switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.RUN)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN)
result = __configureCustomExecutable__(projectName, port, mkspec, qtVersion)
if result:
clickButton(waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' text='Details' "
......@@ -54,9 +54,9 @@ def modifyRunSettingsForHookInto(projectName, port):
switchViewTo(ViewConstants.EDIT)
return result
def modifyRunSettingsForHookIntoQtQuickUI(workingDir, projectName, port):
def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.RUN, True)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN, True)
qtVersion, mkspec, qtLibPath, qmake = getQtInformationForQmlProject()
if None in (qtVersion, mkspec, qtLibPath, qmake):
......
......@@ -103,6 +103,7 @@ def setRunInTerminal(targetCount, currentTarget, runInTerminal=True):
switchViewTo(ViewConstants.EDIT)
# helper function to get some Qt information for the current (already configured) project
# param kitCount is the number of kits cofigured for the current project
# param alreadyOnProjectsBuildSettings if set to True you have to make sure that you're
# on the Projects view on the Build settings page (otherwise this function will end
# up in a ScriptError)
......@@ -114,10 +115,10 @@ def setRunInTerminal(targetCount, currentTarget, runInTerminal=True):
# * the third element holds the Qt bin path
# * the fourth element holds the Qt lib path
# of the current active project
def getQtInformationForBuildSettings(alreadyOnProjectsBuildSettings=False, afterSwitchTo=None):
def getQtInformationForBuildSettings(kitCount, alreadyOnProjectsBuildSettings=False, afterSwitchTo=None):
if not alreadyOnProjectsBuildSettings:
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.BUILD)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.BUILD)
clickButton(waitForObject(":Qt Creator_SystemSettings.Details_Utils::DetailsButton"))
model = waitForObject(":scrollArea_QTableView").model()
qtDir = None
......
......@@ -9,7 +9,7 @@ def main():
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
test.log("Building project")
result = modifyRunSettingsForHookInto(projectName, 11223)
result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223)
invokeMenuItem("Build", "Build All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
if not checkCompile():
......
......@@ -14,7 +14,7 @@ def main():
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
test.log("Building project")
result = modifyRunSettingsForHookInto(projectName, 11223)
result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223)
invokeMenuItem("Build","Build All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
if not checkCompile():
......
......@@ -6,7 +6,12 @@ def main():
workingDir = tempDir()
projectName = createNewQtQuickUI(workingDir)
test.log("Running project")
qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(workingDir, projectName, 11223)
# TODO replace this quickfix with a proper identification of kits
# changes to createNewQtQuickUI(...) after fixing QTCREATORBUG-8704 will probably handle this
kitCount = 1
if platform.system() in ('Windows', 'Microsoft'):
kitCount = 2
qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, 11223)
if qmlViewer!=None:
qmlViewerPath = os.path.dirname(qmlViewer)
qmlViewer = os.path.basename(qmlViewer)
......
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