forked from qt-creator/qt-creator
Squish: Do not expect clang shipped by QC anymore
Change-Id: I2f09835bde52aa2f0cd90def7f6d8d628736ff56 Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
@@ -171,37 +171,6 @@ 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 __extendExpectedCompilersWithInternalClang__(expected):
|
|
||||||
global appContext
|
|
||||||
# QC ships a clang itself
|
|
||||||
regex = '^(.*(qtcreator(.exe)?|Qt Creator))( .*)?$' # QC with optional arguments
|
|
||||||
qcPath = re.match(regex, appContext.commandLine)
|
|
||||||
if qcPath is None:
|
|
||||||
test.warning("Regular expression failed.")
|
|
||||||
else:
|
|
||||||
qcPath = qcPath.group(1)
|
|
||||||
if platform.system() == 'Darwin':
|
|
||||||
internalClang = os.path.join(qcPath, '..', '..', 'Resources')
|
|
||||||
elif platform.system() in ('Windows', 'Microsoft'):
|
|
||||||
internalClang = os.path.join(qcPath, '..')
|
|
||||||
else:
|
|
||||||
internalClang = os.path.join(qcPath, '..', '..', 'libexec', 'qtcreator')
|
|
||||||
internalClang = os.path.join(internalClang, 'clang', 'bin', 'clang')
|
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
|
||||||
internalClang += '-cl.exe'
|
|
||||||
internalClang = os.path.abspath(internalClang)
|
|
||||||
if os.path.exists(internalClang):
|
|
||||||
if platform.system() in ('Microsoft', 'Windows'):
|
|
||||||
# just add a fuzzy comparable name - everything else is not worth the effort here
|
|
||||||
expected.append({'^Default LLVM \d{2} bit based on MSVC\d{4}$':''})
|
|
||||||
else:
|
|
||||||
expected.append(internalClang)
|
|
||||||
else:
|
|
||||||
test.fail("QC package seems to be faulty - missing internal provided clang.\nIf this "
|
|
||||||
"is not a package, but a self-compiled QC, just copy the clang executable "
|
|
||||||
"located inside the LLVM_INSTALL_DIR/bin (used while building) to the "
|
|
||||||
"expected path.", "Expected '%s'" % internalClang)
|
|
||||||
|
|
||||||
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 = []
|
||||||
@@ -219,8 +188,6 @@ 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)
|
||||||
|
|
||||||
__extendExpectedCompilersWithInternalClang__(expected)
|
|
||||||
|
|
||||||
for compiler in compilers:
|
for compiler in compilers:
|
||||||
compilerPath = which(compiler)
|
compilerPath = which(compiler)
|
||||||
if compilerPath:
|
if compilerPath:
|
||||||
@@ -309,13 +276,6 @@ def __compareCompilers__(foundCompilers, expectedCompilers):
|
|||||||
if isString(currentExp):
|
if isString(currentExp):
|
||||||
continue
|
continue
|
||||||
key = currentExp.keys()[0]
|
key = currentExp.keys()[0]
|
||||||
# special case for (fuzzy) regex comparison on Windows (internal LLVM)
|
|
||||||
if isWin and key.startswith('^') and key.endswith('$'):
|
|
||||||
if re.match(key, currentFound.keys()[0], flags):
|
|
||||||
test.verify(os.path.exists(currentFound.values()[0].rsplit(" ", 1)[0]),
|
|
||||||
"Verifying whether shipped clang got set up.")
|
|
||||||
foundExp = True
|
|
||||||
break
|
|
||||||
# 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, currentFound.keys()[0], flags))
|
if (((".*?" in key and re.match(key, currentFound.keys()[0], flags))
|
||||||
|
Reference in New Issue
Block a user