From feaff29b7803c7376bf58e5a22e790fee20b4d85 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 7 Jun 2017 12:10:45 +0200 Subject: [PATCH] Squish: Use cdb with Creator's bitness Normal builds of Creator can only use cdb with the same bitness. In the official packages this is being solved by sharing qtcreatorcdbextXX between 32- and 64-bit builds. Change-Id: Ib31e4d71789065bef908bf13569de4284ae20de9 Reviewed-by: Christian Stenger --- .../windows/QtProject/qtcreator/debuggers.xml | 6 ++--- tests/system/shared/qtcreator.py | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml b/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml index e5518c8c99d..b8d5b705e11 100644 --- a/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml +++ b/tests/system/settings/windows/QtProject/qtcreator/debuggers.xml @@ -6,12 +6,12 @@ DebuggerItem.0 - x86-windows-msvc2015-pe-64bit + x86-windows-msvc2015-pe-SQUISH_DEBUGGER_BITNESSbit true - C:/Program Files (x86)/Windows Kits/10/Debuggers/x64/cdb.exe - Auto-detected CDB at C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe + C:/Program Files (x86)/Windows Kits/10/Debuggers/SQUISH_DEBUGGER_ARCHITECTURE/cdb.exe + Auto-detected CDB at C:\Program Files (x86)\Windows Kits\10\Debuggers\SQUISH_DEBUGGER_ARCHITECTURE\cdb.exe 4 {1b25f20a-d584-4fb7-85b3-74dd15b82f6f} diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index afed6c118d4..71efd63f428 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -186,6 +186,30 @@ def substituteDefaultCompiler(settingsDir): __substitute__(qtversion, "SQUISH_DEFAULT_COMPILER", compiler) test.log("Injected default compiler '%s' to qtversion.xml..." % compiler) +def substituteCdb(settingsDir): + def canUse32bitCdb(): + try: + serverIni = readFile(os.path.join(os.getenv("APPDATA"), "froglogic", + "Squish", "ver1", "server.ini")) + autLine = filter(lambda line: "AUT/qtcreator" in line, serverIni.splitlines())[0] + autPath = autLine.split("\"")[1] + return os.path.exists(os.path.join(autPath, "..", "lib", "qtcreatorcdbext32")) + except: + test.fatal("Something went wrong when determining debugger bitness", + "Did Squish's file structure change? Guessing 32-bit cdb can be used...") + return True + + if canUse32bitCdb(): + architecture = "x86" + bitness = "32" + else: + architecture = "x64" + bitness = "64" + debuggers = os.path.join(settingsDir, "QtProject", 'qtcreator', 'debuggers.xml') + __substitute__(debuggers, "SQUISH_DEBUGGER_ARCHITECTURE", architecture) + __substitute__(debuggers, "SQUISH_DEBUGGER_BITNESS", bitness) + test.log("Injected architecture '%s' and bitness '%s' in cdb path..." % (architecture, bitness)) + def __guessABI__(supportedABIs, use64Bit): if platform.system() == 'Linux': supportedABIs = filter(lambda x: 'linux' in x, supportedABIs) @@ -277,6 +301,8 @@ def copySettingsToTmpDir(destination=None, omitFiles=[]): if platform.system() in ('Linux', 'Darwin'): substituteTildeWithinToolchains(tmpSettingsDir) substituteDefaultCompiler(tmpSettingsDir) + elif platform.system() in ('Windows', 'Microsoft'): + substituteCdb(tmpSettingsDir) substituteUnchosenTargetABIs(tmpSettingsDir) SettingsPath = ' -settingspath "%s"' % tmpSettingsDir