From 3b7d9178ae6e1130a0ee8e7941d01e75424db224 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 25 Mar 2024 14:48:54 +0100 Subject: [PATCH] SquishTests: Fix default settings test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../suite_general/tst_default_settings/test.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 0b2f1dea624..194a8ac4ccf 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -41,6 +41,8 @@ def __checkKits__(): internalClangExe += ".exe" internalClangExe = os.path.realpath(internalClangExe) # clean symlinks 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) foundCompilers = [] foundCompilerNames = [] @@ -269,6 +271,13 @@ def __getExpectedDebuggers__(): result = [] if platform.system() in ('Microsoft', 'Windows'): 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" for debugger in ["gdb", "lldb"]: result.extend(findAllFilesInPATH(debugger + exeSuffix)) @@ -330,6 +339,11 @@ def __compareCompilers__(foundCompilers, expectedCompilers): or currentFound.values() == currentExp.values()): foundExp = True 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 else: if isWin: