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) ; }