Abi: Allow overriding the detected abis of the gcc tool chain

Change-Id: Ief8985a0f6c8746bb5a0c15c8dcec5387b379159
Reviewed-on: http://codereview.qt.nokia.com/267
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Tobias Hunger
2011-05-24 14:06:51 +00:00
parent e75e2b0c4d
commit a5dadc76aa
8 changed files with 372 additions and 42 deletions

View File

@@ -532,6 +532,30 @@ QString Abi::toString(int w)
return QString::fromLatin1("%1bit").arg(w);
}
QList<Abi::OSFlavor> Abi::flavorsForOs(const Abi::OS &o)
{
QList<OSFlavor> result;
switch (o) {
case BsdOS:
return result << FreeBsdFlavor << OpenBsdFlavor << NetBsdFlavor;
case LinuxOS:
return result << GenericLinuxFlavor << HarmattanLinuxFlavor << MaemoLinuxFlavor << MeegoLinuxFlavor;
case MacOS:
return result << GenericMacFlavor;
case SymbianOS:
return result << SymbianDeviceFlavor << SymbianEmulatorFlavor;
case UnixOS:
return result << GenericUnixFlavor << SolarisUnixFlavor;
case WindowsOS:
return result << WindowsMsvc2005Flavor << WindowsMsvc2008Flavor << WindowsMsvc2010Flavor
<< WindowsMSysFlavor << WindowsCEFlavor;
case UnknownOS:
return result << UnknownFlavor;
default:
break;
}
return result;
}
Abi Abi::hostAbi()
{
@@ -742,4 +766,23 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary()
QCOMPARE(result.at(i).toString(), abis.at(i));
}
void ProjectExplorer::ProjectExplorerPlugin::testFlavorForOs()
{
QList<QList<ProjectExplorer::Abi::OSFlavor> > flavorLists;
for (int i = 0; i != static_cast<int>(Abi::UnknownOS); ++i)
flavorLists.append(Abi::flavorsForOs(static_cast<Abi::OS>(i)));
int foundCounter = 0;
for (int i = 0; i != Abi::UnknownFlavor; ++i) {
foundCounter = 0;
// make sure i is in exactly on of the flavor lists!
foreach (const QList<Abi::OSFlavor> &l, flavorLists) {
QVERIFY(!l.contains(Abi::UnknownFlavor));
if (l.contains(static_cast<Abi::OSFlavor>(i)))
++foundCounter;
}
QCOMPARE(foundCounter, 1);
}
}
#endif