forked from qt-creator/qt-creator
Squish: Fix expected compilers on Windows
Compilers will be nowadays displayed with full version. VS 2019 and 2022 are out for a long time and have been added. Ensure installed official LLVM is detected correctly. Change-Id: Ica29dca74cb8e08bafda1a88fcd2c2a6150bb236 Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
@@ -105,8 +105,15 @@ def __compFunc__(it, foundComp, foundCompNames):
|
|||||||
pathLineEdit = findObject(":Path.Utils_BaseValidatingLineEdit")
|
pathLineEdit = findObject(":Path.Utils_BaseValidatingLineEdit")
|
||||||
foundComp.append(str(pathLineEdit.text))
|
foundComp.append(str(pathLineEdit.text))
|
||||||
except:
|
except:
|
||||||
varsBatCombo = waitForObjectExists("{name='varsBatCombo' type='QComboBox' visible='1'}")
|
varsBatComboStr = "{name='varsBatCombo' type='QComboBox' visible='1'}"
|
||||||
foundComp.append({it:str(varsBatCombo.currentText)})
|
varsBatCombo = waitForObjectExists(varsBatComboStr)
|
||||||
|
parameterComboStr = "{type='QComboBox' visible='1' unnamed='1' leftWidget=%s}" % varsBatComboStr
|
||||||
|
try:
|
||||||
|
parameterCombo = findObject(parameterComboStr)
|
||||||
|
parameter = ' ' + str(parameterCombo.currentText)
|
||||||
|
except:
|
||||||
|
parameter = ''
|
||||||
|
foundComp.append({it:str(varsBatCombo.currentText) + parameter})
|
||||||
|
|
||||||
foundCompNames.append(it)
|
foundCompNames.append(it)
|
||||||
|
|
||||||
@@ -156,6 +163,21 @@ def __kitFunc__(it, foundQt, foundCompNames):
|
|||||||
details = details.replace("<b>", "").replace("</b>", "")
|
details = details.replace("<b>", "").replace("</b>", "")
|
||||||
test.warning("Detected error and/or warning: %s" % details)
|
test.warning("Detected error and/or warning: %s" % details)
|
||||||
|
|
||||||
|
def __LLVMInRegistry__():
|
||||||
|
# following only works on Win64 (Win32 has different registry keys)
|
||||||
|
try:
|
||||||
|
output = subprocess.check_output(['reg', 'query',
|
||||||
|
r'HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\LLVM\LLVM'],
|
||||||
|
shell=True)
|
||||||
|
for line in output.splitlines():
|
||||||
|
if '(Default)' in line:
|
||||||
|
path = line.split(' REG_SZ ')[1].strip()
|
||||||
|
if os.path.exists(os.path.join(path, 'bin', 'clang-cl.exe')):
|
||||||
|
return True
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
pass
|
||||||
|
return False
|
||||||
|
|
||||||
def __getExpectedCompilers__():
|
def __getExpectedCompilers__():
|
||||||
# TODO: enhance this to distinguish between C and C++ compilers
|
# TODO: enhance this to distinguish between C and C++ compilers
|
||||||
expected = []
|
expected = []
|
||||||
@@ -173,6 +195,11 @@ def __getExpectedCompilers__():
|
|||||||
if xcodeClang and os.path.exists(xcodeClang) and xcodeClang not in expected:
|
if xcodeClang and os.path.exists(xcodeClang) and xcodeClang not in expected:
|
||||||
expected.append(xcodeClang)
|
expected.append(xcodeClang)
|
||||||
|
|
||||||
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
|
clangClInPath = len(findAllFilesInPATH('clang-cl.exe'))
|
||||||
|
if clangClInPath > 0 or __LLVMInRegistry__():
|
||||||
|
expected.append({'^LLVM \d{2} bit based on MSVC\d{4}$' : ''})
|
||||||
|
|
||||||
for compiler in compilers:
|
for compiler in compilers:
|
||||||
compilerPath = which(compiler)
|
compilerPath = which(compiler)
|
||||||
if compilerPath:
|
if compilerPath:
|
||||||
@@ -195,19 +222,23 @@ def __getWinCompilers__():
|
|||||||
parameters = testData.field(record, "displayedParameters").split(",")
|
parameters = testData.field(record, "displayedParameters").split(",")
|
||||||
usedParameters = testData.field(record, "usedParameters").split(",")
|
usedParameters = testData.field(record, "usedParameters").split(",")
|
||||||
idePath = testData.field(record, "IDEPath")
|
idePath = testData.field(record, "IDEPath")
|
||||||
|
displayName = testData.field(record, 'displayName')
|
||||||
if len(idePath):
|
if len(idePath):
|
||||||
if not os.path.exists(os.path.abspath(os.path.join(envvar, idePath))):
|
if not os.path.exists(os.path.abspath(os.path.join(envvar, idePath))):
|
||||||
continue
|
continue
|
||||||
if testData.field(record, "isSDK") == "true":
|
if testData.field(record, "isSDK") == "true":
|
||||||
for para, used in zip(parameters, usedParameters):
|
for para, used in zip(parameters, usedParameters):
|
||||||
result.append(
|
result.append(
|
||||||
{"%s \(.*?\) \(%s\)" % (testData.field(record, 'displayName'),
|
{"%s \(.*?\) \(%s\)" % (displayName, para)
|
||||||
para)
|
: "%s %s" % (compiler, used)})
|
||||||
:"%s %s" % (compiler, used)})
|
|
||||||
else:
|
else:
|
||||||
for para, used in zip(parameters, usedParameters):
|
for para, used in zip(parameters, usedParameters):
|
||||||
result.append({"%s (%s)" % (testData.field(record, 'displayName'), para)
|
if "[.0-9]+" in displayName:
|
||||||
:"%s %s" % (compiler, used)})
|
result.append({"%s \(%s\)" % (displayName, para)
|
||||||
|
: "%s %s" % (compiler, used)})
|
||||||
|
else:
|
||||||
|
result.append({"%s (%s)" % (displayName, para)
|
||||||
|
: "%s %s" % (compiler, used)})
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def __getExpectedDebuggers__():
|
def __getExpectedDebuggers__():
|
||||||
@@ -263,8 +294,10 @@ def __compareCompilers__(foundCompilers, expectedCompilers):
|
|||||||
key = list(currentExp.keys())[0]
|
key = list(currentExp.keys())[0]
|
||||||
# the regex .*? is used for the different possible version strings of the WinSDK
|
# the regex .*? is used for the different possible version strings of the WinSDK
|
||||||
# if it's present a regex will be validated otherwise simple string comparison
|
# if it's present a regex will be validated otherwise simple string comparison
|
||||||
if (((".*?" in key and re.match(key, list(currentFound.keys())[0], flags))
|
# same applies for [.0-9]+ which is used for minor/patch versions
|
||||||
or currentFound.keys() == currentExp.keys())):
|
isRegex = ".*?" in key or "[.0-9]+" in key
|
||||||
|
if (((isRegex and re.match(key, list(currentFound.keys())[0], flags)))
|
||||||
|
or currentFound.keys() == currentExp.keys()):
|
||||||
if ((isWin and os.path.abspath(currentFound.values()[0].lower())
|
if ((isWin and os.path.abspath(currentFound.values()[0].lower())
|
||||||
== os.path.abspath(currentExp.values()[0].lower()))
|
== os.path.abspath(currentExp.values()[0].lower()))
|
||||||
or currentFound.values() == currentExp.values()):
|
or currentFound.values() == currentExp.values()):
|
||||||
|
@@ -23,6 +23,9 @@
|
|||||||
"VS120COMNTOOLS" "..\..\VC" "vcvarsall.bat" "Microsoft Visual C++ Compiler 12.0" "x86,amd64,x86_amd64,ia64,x86_ia64" "x86,amd64,x86_amd64,ia64,x86_ia64" "false" ""
|
"VS120COMNTOOLS" "..\..\VC" "vcvarsall.bat" "Microsoft Visual C++ Compiler 12.0" "x86,amd64,x86_amd64,ia64,x86_ia64" "x86,amd64,x86_amd64,ia64,x86_ia64" "false" ""
|
||||||
"VS140COMNTOOLS" "..\..\VC\Bin" "vcvars32.bat" "Microsoft Visual C++ Compiler 14.0" "x86" "" "false" "..\IDE\devenv.exe"
|
"VS140COMNTOOLS" "..\..\VC\Bin" "vcvars32.bat" "Microsoft Visual C++ Compiler 14.0" "x86" "" "false" "..\IDE\devenv.exe"
|
||||||
"VS140COMNTOOLS" "..\..\VC" "vcvarsall.bat" "Microsoft Visual C++ Compiler 14.0" "x86,amd64,x86_amd64,x86_arm,amd64_arm,amd64_x86" "x86,amd64,x86_amd64,x86_arm,amd64_arm,amd64_x86" "false" "..\IDE\devenv.exe"
|
"VS140COMNTOOLS" "..\..\VC" "vcvarsall.bat" "Microsoft Visual C++ Compiler 14.0" "x86,amd64,x86_amd64,x86_arm,amd64_arm,amd64_x86" "x86,amd64,x86_amd64,x86_arm,amd64_arm,amd64_x86" "false" "..\IDE\devenv.exe"
|
||||||
|
"VS140COMNTOOLS" "..\..\VC" "vcvarsall.bat" "Microsoft Visual C\+\+ Compiler 14[.0-9]+" "x86,amd64,x86_amd64,x86_arm,amd64_arm,amd64_x86" "x86,amd64,x86_amd64,x86_arm,amd64_arm,amd64_x86" "false" ""
|
||||||
"ProgramFiles" "Microsoft Visual C++ Build Tools" "vcbuildtools.bat" "Microsoft Visual C++ Build Tools" "x86,x64,x86_arm,x64_arm" "x86,amd64,x86_arm,amd64_arm" "false" ""
|
"ProgramFiles" "Microsoft Visual C++ Build Tools" "vcbuildtools.bat" "Microsoft Visual C++ Build Tools" "x86,x64,x86_arm,x64_arm" "x86,amd64,x86_arm,amd64_arm" "false" ""
|
||||||
"ProgramFiles(x86)" "Microsoft Visual C++ Build Tools" "vcbuildtools.bat" "Microsoft Visual C++ Build Tools" "x86,x64,x86_arm,x64_arm" "x86,amd64,x86_arm,amd64_arm" "false" ""
|
"ProgramFiles(x86)" "Microsoft Visual C++ Build Tools" "vcbuildtools.bat" "Microsoft Visual C++ Build Tools" "x86,x64,x86_arm,x64_arm" "x86,amd64,x86_arm,amd64_arm" "false" ""
|
||||||
"ProgramFiles(x86)" "Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build" "vcvarsall.bat" "Microsoft Visual C++ Compiler 15.0" "x86,amd64_x86,amd64,x86_amd64" "x86,amd64_x86,amd64,x86_amd64" "false" ""
|
"ProgramFiles(x86)" "Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build" "vcvarsall.bat" "Microsoft Visual C\+\+ Compiler 15[.0-9]+" "x86,amd64_x86,amd64,x86_amd64" "x86,amd64_x86,amd64,x86_amd64" "false" ""
|
||||||
|
"ProgramFiles(x86)" "Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build" "vcvarsall.bat" "Microsoft Visual C\+\+ Compiler 16[.0-9]+" "x86,amd64_x86,amd64,x86_amd64" "x86,amd64_x86,amd64,x86_amd64" "false" ""
|
||||||
|
"ProgramFiles" "Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build" "vcvarsall.bat" "Microsoft Visual C\+\+ Compiler 17[.0-9]+" "x86,amd64_x86,amd64,x86_amd64" "x86,amd64_x86,amd64,x86_amd64" "false" ""
|
||||||
|
Can't render this file because it contains an unexpected character in line 26 and column 195.
|
Reference in New Issue
Block a user