[test] use cmake to run unit tests (#8724)

This commit migrates unit tests to cmake.
* build unit tests with cmake
* add missing tests in cmake
* use ctest
* add platform udp stubs for test platform
* skip some static_assert with gcc-4
This commit is contained in:
Yakun Xu
2023-02-09 10:19:01 -08:00
committed by GitHub
parent 6e6a2ae145
commit 0e667b8e03
19 changed files with 273 additions and 472 deletions
+60
View File
@@ -445,4 +445,64 @@ OT_TOOL_WEAK void otPlatDsoDisconnect(otPlatDsoConnection *aConnection, otPlatDs
#endif // #if OPENTHREAD_CONFIG_DNS_DSO_ENABLE
#if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
otError otPlatUdpSocket(otUdpSocket *aUdpSocket)
{
OT_UNUSED_VARIABLE(aUdpSocket);
return OT_ERROR_NONE;
}
otError otPlatUdpClose(otUdpSocket *aUdpSocket)
{
OT_UNUSED_VARIABLE(aUdpSocket);
return OT_ERROR_NONE;
}
otError otPlatUdpBind(otUdpSocket *aUdpSocket)
{
OT_UNUSED_VARIABLE(aUdpSocket);
return OT_ERROR_NONE;
}
otError otPlatUdpBindToNetif(otUdpSocket *aUdpSocket, otNetifIdentifier aNetifIdentifier)
{
OT_UNUSED_VARIABLE(aUdpSocket);
OT_UNUSED_VARIABLE(aNetifIdentifier);
return OT_ERROR_NONE;
}
otError otPlatUdpConnect(otUdpSocket *aUdpSocket)
{
OT_UNUSED_VARIABLE(aUdpSocket);
return OT_ERROR_NONE;
}
otError otPlatUdpSend(otUdpSocket *aUdpSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
OT_UNUSED_VARIABLE(aUdpSocket);
OT_UNUSED_VARIABLE(aMessageInfo);
return OT_ERROR_NONE;
}
otError otPlatUdpJoinMulticastGroup(otUdpSocket *aUdpSocket,
otNetifIdentifier aNetifIdentifier,
const otIp6Address *aAddress)
{
OT_UNUSED_VARIABLE(aUdpSocket);
OT_UNUSED_VARIABLE(aNetifIdentifier);
OT_UNUSED_VARIABLE(aAddress);
return OT_ERROR_NONE;
}
otError otPlatUdpLeaveMulticastGroup(otUdpSocket *aUdpSocket,
otNetifIdentifier aNetifIdentifier,
const otIp6Address *aAddress)
{
OT_UNUSED_VARIABLE(aUdpSocket);
OT_UNUSED_VARIABLE(aNetifIdentifier);
OT_UNUSED_VARIABLE(aAddress);
return OT_ERROR_NONE;
}
#endif // OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
} // extern "C"