SquishTests: Fix default settings test

QC nowadays provides lldb on Windows which gets automatically
registered.
Beside this correct expectations for the compiler based on the
LLVM path that had been used for building the QC package and
might be the same on the machine the test runs on.

Change-Id: Ie9553b79bb0eb0012386bd71422005c184638046
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2024-03-25 14:48:54 +01:00
parent b97225ae64
commit 3b7d9178ae

View File

@@ -41,6 +41,8 @@ def __checkKits__():
internalClangExe += ".exe" internalClangExe += ".exe"
internalClangExe = os.path.realpath(internalClangExe) # clean symlinks internalClangExe = os.path.realpath(internalClangExe) # clean symlinks
if os.path.exists(internalClangExe): if os.path.exists(internalClangExe):
if platform.system() in ("Microsoft", "Windows"):
expectedCompilers.append({'^Default LLVM \d{2} bit based on MSVC\d{4}$' : ''})
expectedCompilers.append(internalClangExe) expectedCompilers.append(internalClangExe)
foundCompilers = [] foundCompilers = []
foundCompilerNames = [] foundCompilerNames = []
@@ -269,6 +271,13 @@ def __getExpectedDebuggers__():
result = [] result = []
if platform.system() in ('Microsoft', 'Windows'): if platform.system() in ('Microsoft', 'Windows'):
result.extend(__getCDB__()) result.extend(__getCDB__())
try:
qcBinPath = currentApplicationContext().commandLine.split('qtcreator.exe', 1)[0]
lldb = os.path.join(qcBinPath, 'clang', 'bin', 'lldb.exe')
if os.path.exists(lldb):
result.append(lldb)
except:
test.warning('Failed to handled internally provided lldb.')
exeSuffix = ".exe" exeSuffix = ".exe"
for debugger in ["gdb", "lldb"]: for debugger in ["gdb", "lldb"]:
result.extend(findAllFilesInPATH(debugger + exeSuffix)) result.extend(findAllFilesInPATH(debugger + exeSuffix))
@@ -330,6 +339,11 @@ def __compareCompilers__(foundCompilers, expectedCompilers):
or currentFound.values() == currentExp.values()): or currentFound.values() == currentExp.values()):
foundExp = True foundExp = True
break break
if isWin and key.startswith('^Default LLVM'):
if re.match(key, next(iter(currentFound.keys())), flags):
# TODO we may want to check that it's configured with latest MSVC?
foundExp = True
break
equal = foundExp equal = foundExp
else: else:
if isWin: if isWin: