mirror of
https://github.com/espressif/openthread.git
synced 2026-08-20 09:29:51 +00:00
[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:
@@ -64,9 +64,12 @@ void TestBinarySearch(void)
|
||||
constexpr Entry kUnsortedTable[] = {{"z", 0}, {"a", 0}, {"b", 0}};
|
||||
constexpr Entry kDuplicateEntryTable[] = {{"duplicate", 1}, {"duplicate", 2}};
|
||||
|
||||
// gcc-4 does not support constexpr function
|
||||
#if __GNUC__ > 4
|
||||
static_assert(BinarySearch::IsSorted(kTable), "IsSorted() failed");
|
||||
static_assert(!BinarySearch::IsSorted(kUnsortedTable), "failed for unsorted table");
|
||||
static_assert(!BinarySearch::IsSorted(kDuplicateEntryTable), "failed for table with duplicate entries");
|
||||
#endif
|
||||
|
||||
for (const Entry &tableEntry : kTable)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user