forked from qt-creator/qt-creator
ClangTools: Do not run tests with x86/32 bit MSVC kits
According to observations, clazy stumbles over system headers in that case. Change-Id: I824571caeceb4ee7a201a2bfa797d1795eb972b6 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -40,19 +40,26 @@ namespace Internal {
|
||||
|
||||
void ClangToolsUnitTests::initTestCase()
|
||||
{
|
||||
const QList<Kit *> allKits = KitManager::kits();
|
||||
if (allKits.count() == 0)
|
||||
QSKIP("This test requires at least one kit to be present");
|
||||
m_kit = findOr(KitManager::kits(), nullptr, [](Kit *k) {
|
||||
if (!k->isValid())
|
||||
return false;
|
||||
if (!QtSupport::QtKitAspect::qtVersion(k))
|
||||
return false;
|
||||
const Toolchain * const toolchain = ToolchainKitAspect::cxxToolchain(k);
|
||||
if (!toolchain)
|
||||
return false;
|
||||
|
||||
m_kit = findOr(allKits, nullptr, [](Kit *k) {
|
||||
return k->isValid() && QtSupport::QtKitAspect::qtVersion(k) != nullptr;
|
||||
// Wo observe clazy failures with x86/32bit MSVC kits.
|
||||
if (toolchain->typeId() == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID
|
||||
&& toolchain->targetAbi().architecture() == Abi::X86Architecture
|
||||
&& toolchain->targetAbi().wordWidth() != Abi::hostAbi().wordWidth()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
if (!m_kit)
|
||||
QSKIP("This test requires at least one valid kit with a valid Qt");
|
||||
|
||||
const Toolchain * const toolchain = ToolchainKitAspect::cxxToolchain(m_kit);
|
||||
if (!toolchain)
|
||||
QSKIP("This test requires that there is a kit with a toolchain.");
|
||||
QSKIP("This test requires at least one valid kit with a valid Qt and a suitable toolchain.");
|
||||
|
||||
if (!Core::ICore::clangExecutable(CLANG_BINDIR))
|
||||
QSKIP("No clang suitable for analyzing found");
|
||||
|
Reference in New Issue
Block a user