void testFromString() { QFETCH(QString, id); QFETCH(bool, valid); QFETCH(int, majorVersion); QFETCH(int, minorVersion); QFETCH(bool, isDebug); QFETCH(QString, arch); QFETCH(QString, compiler); #ifdef Q_OS_WIN QFETCH(QString, compilerVersion); #endif const ProbeABI abi = ProbeABI::fromString(id); QCOMPARE(abi.isValid(), valid); if (!valid) return; QCOMPARE(abi.majorQtVersion(), majorVersion); QCOMPARE(abi.minorQtVersion(), minorVersion); QCOMPARE(abi.architecture(), arch); if (abi.isDebugRelevant()) { QCOMPARE(abi.isDebug(), isDebug); } #ifdef Q_OS_WIN QCOMPARE(abi.compiler(), compiler); QCOMPARE(abi.compilerVersion(), compilerVersion); #else Q_UNUSED(compiler); #endif }
bool ProbeABI::operator==(const ProbeABI& rhs) const { return majorQtVersion() == rhs.majorQtVersion() && minorQtVersion() == rhs.minorQtVersion() && architecture() == rhs.architecture() && compiler() == rhs.compiler() && isDebug() == rhs.isDebug(); }
bool ProbeABI::isCompatible(const ProbeABI& referenceABI) const { return d->majorQtVersion == referenceABI.majorQtVersion() && d->minorQtVersion >= referenceABI.minorQtVersion() // we can work with older probes, since the target defines the Qt libraries being used && d->architecture == referenceABI.architecture() #ifdef Q_OS_WIN && d->compiler == referenceABI.compiler() #endif && (isDebugRelevant() ? d->isDebug == referenceABI.isDebug() : true) ; }
AbstractInjector::Ptr defaultInjectorForLaunch(const ProbeABI &abi) { #if defined(Q_OS_MAC) if (abi.majorQtVersion() >= 5 && abi.minorQtVersion() >= 4) return createInjector(QLatin1String("preload")); return findFirstWorkingInjector(QStringList() << QLatin1String("lldb") << QLatin1String("gdb")); #elif defined(Q_OS_UNIX) Q_UNUSED(abi); return createInjector(QLatin1String("preload")); #else Q_UNUSED(abi); return createInjector(QLatin1String("windll")); #endif }
bool ProbeABI::operator<(const ProbeABI& rhs) const { if (majorQtVersion() == rhs.majorQtVersion()) return minorQtVersion() < rhs.minorQtVersion(); return majorQtVersion() < rhs.majorQtVersion(); }