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()
|
void ClangToolsUnitTests::initTestCase()
|
||||||
{
|
{
|
||||||
const QList<Kit *> allKits = KitManager::kits();
|
m_kit = findOr(KitManager::kits(), nullptr, [](Kit *k) {
|
||||||
if (allKits.count() == 0)
|
if (!k->isValid())
|
||||||
QSKIP("This test requires at least one kit to be present");
|
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) {
|
// Wo observe clazy failures with x86/32bit MSVC kits.
|
||||||
return k->isValid() && QtSupport::QtKitAspect::qtVersion(k) != nullptr;
|
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)
|
if (!m_kit)
|
||||||
QSKIP("This test requires at least one valid kit with a valid Qt");
|
QSKIP("This test requires at least one valid kit with a valid Qt and a suitable toolchain.");
|
||||||
|
|
||||||
const Toolchain * const toolchain = ToolchainKitAspect::cxxToolchain(m_kit);
|
|
||||||
if (!toolchain)
|
|
||||||
QSKIP("This test requires that there is a kit with a toolchain.");
|
|
||||||
|
|
||||||
if (!Core::ICore::clangExecutable(CLANG_BINDIR))
|
if (!Core::ICore::clangExecutable(CLANG_BINDIR))
|
||||||
QSKIP("No clang suitable for analyzing found");
|
QSKIP("No clang suitable for analyzing found");
|
||||||
|
Reference in New Issue
Block a user