Issues/issue 461 update to zephyr v3 4 0 in ci (#463)

* [WIP] Remove unit testcases duplicated under non-unit tree

* [WIP] Update west.yml to Zephyr v3.3.0 (twister verified)

* Update CI to Zephyr v3.4.0 w/ reduced module set

- Update zephyr/module.yml to use Zephyr v3.4.0 + cmsis;
- Update tests to use ZTEST_NEW_API for zephyr builds

Verified by:

1. make clean test
2. ./zephyr/scripts/twister -p unit_testing -T bacnet/zephyr/tests/bacnet

---------

Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
This commit is contained in:
Greg Shue
2023-07-26 14:47:01 -07:00
committed by GitHub
parent 3f7a4d2e19
commit dad9e13485
169 changed files with 1299 additions and 77 deletions
+64
View File
@@ -106,7 +106,11 @@ static void test_BVLC_Result_Code(uint16_t result_code)
zassert_equal(result_code, test_result_code, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Result)
#else
static void test_BVLC_Result(void)
#endif
{
uint16_t result_code[] = { BVLC_RESULT_SUCCESSFUL_COMPLETION,
BVLC_RESULT_WRITE_BROADCAST_DISTRIBUTION_TABLE_NAK,
@@ -151,7 +155,11 @@ static void test_BVLC_Original_Unicast_NPDU_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Original_Unicast_NPDU)
#else
static void test_BVLC_Original_Unicast_NPDU(void)
#endif
{
uint8_t npdu[50] = { 0 };
uint16_t npdu_len = 0;
@@ -194,7 +202,11 @@ static void test_BVLC_Original_Broadcast_NPDU_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Original_Broadcast_NPDU)
#else
static void test_BVLC_Original_Broadcast_NPDU(void)
#endif
{
uint8_t npdu[50] = { 0 };
uint16_t npdu_len = 0;
@@ -242,7 +254,11 @@ static void test_BVLC_Forwarded_NPDU_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Forwarded_NPDU)
#else
static void test_BVLC_Forwarded_NPDU(void)
#endif
{
uint8_t npdu[50] = { 0 };
BACNET_IP_ADDRESS bip_address = { 0 };
@@ -285,7 +301,11 @@ static void test_BVLC_Register_Foreign_Device_Message(
zassert_equal(ttl_seconds, test_ttl_seconds, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Register_Foreign_Device)
#else
static void test_BVLC_Register_Foreign_Device(void)
#endif
{
uint16_t ttl_seconds = 0;
@@ -322,7 +342,11 @@ static void test_BVLC_Delete_Foreign_Device_Message(
&fdt_entry->dest_address, &test_fdt_entry.dest_address);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Delete_Foreign_Device)
#else
static void test_BVLC_Delete_Foreign_Device(void)
#endif
{
BACNET_IP_FOREIGN_DEVICE_TABLE_ENTRY fdt_entry = { 0 };
unsigned int i = 0;
@@ -368,7 +392,11 @@ static void test_BVLC_Secure_BVLL_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Secure_BVLL)
#else
static void test_BVLC_Secure_BVLL(void)
#endif
{
uint8_t sbuf[50] = { 0 };
uint16_t sbuf_len = 0;
@@ -383,7 +411,11 @@ static void test_BVLC_Secure_BVLL(void)
test_BVLC_Secure_BVLL_Message(sbuf, sbuf_len);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Read_Broadcast_Distribution_Table_Message)
#else
static void test_BVLC_Read_Broadcast_Distribution_Table_Message(void)
#endif
{
uint8_t pdu[60] = { 0 };
uint8_t message_type = 0;
@@ -428,7 +460,11 @@ static void test_BVLC_Distribute_Broadcast_To_Network_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Distribute_Broadcast_To_Network)
#else
static void test_BVLC_Distribute_Broadcast_To_Network(void)
#endif
{
uint8_t npdu[50] = { 0 };
uint16_t npdu_len = 0;
@@ -443,7 +479,11 @@ static void test_BVLC_Distribute_Broadcast_To_Network(void)
test_BVLC_Distribute_Broadcast_To_Network_Message(npdu, npdu_len);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Broadcast_Distribution_Table_Encode)
#else
static void test_BVLC_Broadcast_Distribution_Table_Encode(void)
#endif
{
uint8_t apdu[480] = { 0 };
uint16_t apdu_len = 0;
@@ -535,7 +575,11 @@ static void test_BVLC_Write_Broadcast_Distribution_Table_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Write_Broadcast_Distribution_Table)
#else
static void test_BVLC_Write_Broadcast_Distribution_Table(void)
#endif
{
uint8_t npdu[480] = { 0 };
uint16_t npdu_len = 0;
@@ -623,7 +667,11 @@ static void test_BVLC_Read_Foreign_Device_Table_Ack_Message(
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Read_Foreign_Device_Table_Ack)
#else
static void test_BVLC_Read_Foreign_Device_Table_Ack(void)
#endif
{
uint8_t npdu[480] = { 0 };
uint16_t npdu_len = 0;
@@ -677,7 +725,11 @@ static void test_BVLC_Read_Foreign_Device_Table_Ack(void)
zassert_equal(test_count, 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Address_Copy)
#else
static void test_BVLC_Address_Copy(void)
#endif
{
unsigned int i = 0;
BACNET_IP_ADDRESS src = { 0 };
@@ -712,7 +764,11 @@ static void test_BVLC_Address_Copy(void)
}
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_Address_Get_Set)
#else
static void test_BVLC_Address_Get_Set(void)
#endif
{
uint16_t i = 0;
BACNET_ADDRESS bsrc = { 0 };
@@ -817,7 +873,11 @@ static void test_BVLC_Address_Get_Set(void)
zassert_equal(octet3, test_octet3, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bvlc_tests, test_BVLC_BBMD_Address)
#else
static void test_BVLC_BBMD_Address(void)
#endif
{
uint8_t apdu[480] = { 0 };
int apdu_len = 0;
@@ -851,6 +911,9 @@ static void test_BVLC_BBMD_Address(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bvlc_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bvlc_tests,
@@ -873,3 +936,4 @@ void test_main(void)
ztest_run_test_suite(bvlc_tests);
}
#endif
+8
View File
@@ -21,7 +21,11 @@
/**
* @brief Test CRC8 from Annex G 1.0 of BACnet Standard
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(cobs_tests, test_COBS_Encode_Decode)
#else
static void test_COBS_Encode_Decode(void)
#endif
{
uint8_t buffer[MAX_APDU] = { 0x55, 0xff, 0 };
uint8_t encoded_buffer[COBS_ENCODED_SIZE(MAX_APDU)+
@@ -52,6 +56,9 @@ static void test_COBS_Encode_Decode(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(cobs_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(cobs_tests,
@@ -60,3 +67,4 @@ void test_main(void)
ztest_run_test_suite(cobs_tests);
}
#endif
+20
View File
@@ -20,7 +20,11 @@
/**
* @brief Test CRC8 from Annex G 1.0 of BACnet Standard
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC8)
#else
static void testCRC8(void)
#endif
{
uint8_t crc = 0xff; /* accumulates the crc value */
uint8_t frame_crc; /* appended to the end of the frame */
@@ -47,7 +51,11 @@ static void testCRC8(void)
/**
* @brief Test CRC8 from Annex G 2.0 of BACnet Standard
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC16)
#else
static void testCRC16(void)
#endif
{
uint16_t crc = 0xffff;
uint16_t data_crc;
@@ -71,7 +79,11 @@ static void testCRC16(void)
/**
* @brief "Test" to create/log generated CRC8 table
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC8CreateTable)
#else
static void testCRC8CreateTable(void)
#endif
{
uint8_t crc = 0xff; /* accumulates the crc value */
int i;
@@ -95,7 +107,11 @@ static void testCRC8CreateTable(void)
/**
* @brief "Test" to create/log generated CRC16 table
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(crc_tests, testCRC16CreateTable)
#else
static void testCRC16CreateTable(void)
#endif
{
uint16_t crc;
int i;
@@ -120,6 +136,9 @@ static void testCRC16CreateTable(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(crc_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(crc_tests,
@@ -131,3 +150,4 @@ void test_main(void)
ztest_run_test_suite(crc_tests);
}
#endif
+24
View File
@@ -32,7 +32,11 @@ void bvlc6_maintenance_timer(uint16_t seconds)
* @brief Test datalink
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_arcnet)
#else
static void test_datalink_arcnet(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -109,7 +113,11 @@ static void test_datalink_arcnet(void)
datalink_maintenance_timer(42);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_bip)
#else
static void test_datalink_bip(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -189,7 +197,11 @@ static void test_datalink_bip(void)
zassert_equal(z_cleanup_mock(), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_bip6)
#else
static void test_datalink_bip6(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -268,7 +280,11 @@ static void test_datalink_bip6(void)
zassert_equal(z_cleanup_mock(), 0, NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, test_datalink_dlmstp)
#else
static void test_datalink_dlmstp(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -345,7 +361,11 @@ static void test_datalink_dlmstp(void)
datalink_maintenance_timer(42);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(datalink_tests, )
#else
static void test_datalink_ethernet(void)
#endif
{
char *iface = "bla-bla-bla";
char *iface2 = "bla-bla-bla2";
@@ -427,6 +447,9 @@ static void test_datalink_ethernet(void)
* @}
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(datalink_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(datalink_tests,
@@ -439,3 +462,4 @@ void test_main(void)
ztest_run_test_suite(datalink_tests);
}
#endif