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
@@ -49,7 +49,11 @@ static void test_color_rgb_xy_unit(
/**
* Unit Test for sRGB to CIE xy
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(color_rgb_tests, test_color_rgb_xy)
#else
static void test_color_rgb_xy(void)
#endif
{
test_color_rgb_xy_unit(0, 0, 0, 0.0, 0.0, 0);
test_color_rgb_xy_unit(255, 255, 255, 0.323, 0.329, 255);
@@ -62,7 +66,11 @@ static void test_color_rgb_xy(void)
/**
* Unit Test for sRGB to CIE xy
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(color_rgb_tests, test_color_rgb_ascii)
#else
static void test_color_rgb_ascii(void)
#endif
{
unsigned count = color_rgb_count();
zassert_true(count > 0, NULL);
@@ -93,6 +101,9 @@ static void test_color_rgb_ascii(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(color_rgb_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(color_rgb_tests,
@@ -102,3 +113,4 @@ void test_main(void)
ztest_run_test_suite(color_rgb_tests);
}
#endif
+20
View File
@@ -42,7 +42,11 @@ static void test_epoch_conversion_date(
/**
* Unit Test for the epoch
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_epoch_conversion)
#else
static void test_days_epoch_conversion(void)
#endif
{
const uint16_t epoch_year = 2000;
@@ -73,7 +77,11 @@ static void test_days_of_year_to_month_day_date(
/**
* Unit Test for the days and year to month date year
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_of_year_to_md)
#else
static void test_days_of_year_to_md(void)
#endif
{
test_days_of_year_to_month_day_date(2029, 145, 5, 25);
test_days_of_year_to_month_day_date(2000, 260, 9, 16);
@@ -101,7 +109,11 @@ static void test_date_is_valid_day(
/**
* Unit Test for the days, checking the date to see if it is a valid date
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_date_is_valid)
#else
static void test_days_date_is_valid(void)
#endif
{
/* first month */
test_date_is_valid_day(0, 1);
@@ -133,7 +145,11 @@ static void test_days_date_is_valid(void)
/**
* Unit Test for days apart, checking the dates to see how many days apart
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(days_tests, test_days_apart)
#else
static void test_days_apart(void)
#endif
{
zassert_equal(days_apart(2000, 1, 1, 2000, 1, 1), 0, NULL);
zassert_equal(days_apart(2000, 1, 1, 2000, 1, 2), 1, NULL);
@@ -148,6 +164,9 @@ static void test_days_apart(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(days_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(days_tests,
@@ -159,3 +178,4 @@ void test_main(void)
ztest_run_test_suite(days_tests);
}
#endif
+8
View File
@@ -20,7 +20,11 @@
/**
* @brief Unit Test for the FIFO buffer
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(fifo_tests, testFIFOBuffer)
#else
static void testFIFOBuffer(void)
#endif
{
/* FIFO data structure */
FIFO_BUFFER test_buffer = { 0 };
@@ -137,6 +141,9 @@ static void testFIFOBuffer(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(fifo_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(fifo_tests,
@@ -145,3 +152,4 @@ void test_main(void)
ztest_run_test_suite(fifo_tests);
}
#endif
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(filename_tests, testFilename)
#else
static void testFilename(void)
#endif
{
char *data1 = "c:\\Joshua\\run";
char *data2 = "/home/Anna/run";
@@ -46,6 +50,9 @@ static void testFilename(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(filename_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(filename_tests,
@@ -54,3 +61,4 @@ void test_main(void)
ztest_run_test_suite(filename_tests);
}
#endif
+28
View File
@@ -19,7 +19,11 @@
/**
* @brief Test the FIFO
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListFIFO)
#else
static void testKeyListFIFO(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -62,7 +66,11 @@ static void testKeyListFIFO(void)
}
/* test the FILO */
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListFILO)
#else
static void testKeyListFILO(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -108,7 +116,11 @@ static void testKeyListFILO(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListDataKey)
#else
static void testKeyListDataKey(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -187,7 +199,11 @@ static void testKeyListDataKey(void)
return;
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListDataIndex)
#else
static void testKeyListDataIndex(void)
#endif
{
OS_Keylist list;
KEY key;
@@ -256,7 +272,11 @@ static void testKeyListDataIndex(void)
}
/* test access of a lot of entries */
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeyListLarge)
#else
static void testKeyListLarge(void)
#endif
{
int data1 = 42;
int *data;
@@ -286,7 +306,11 @@ static void testKeyListLarge(void)
}
/* test the encode and decode macros */
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(keylist_tests, testKeySample)
#else
static void testKeySample(void)
#endif
{
int type, id;
int type_list[] = { 0, 1, KEY_TYPE_MAX / 2, KEY_TYPE_MAX - 1, -1 };
@@ -318,6 +342,9 @@ static void testKeySample(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(keylist_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(keylist_tests,
@@ -331,3 +358,4 @@ void test_main(void)
ztest_run_test_suite(keylist_tests);
}
#endif
+24
View File
@@ -166,7 +166,11 @@ static void testRingBuf(
/**
* Unit Test for the ring buffer with 16 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufSizeSmall)
#else
static void testRingBufSizeSmall(void)
#endif
{
uint8_t data_element[5];
uint8_t data_store[sizeof(data_element) * NEXT_POWER_OF_2(16)];
@@ -178,7 +182,11 @@ static void testRingBufSizeSmall(void)
/**
* Unit Test for the ring buffer with 32 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufSizeLarge)
#else
static void testRingBufSizeLarge(void)
#endif
{
uint8_t data_element[16];
uint8_t data_store[sizeof(data_element) * NEXT_POWER_OF_2(99)];
@@ -190,7 +198,11 @@ static void testRingBufSizeLarge(void)
/**
* Unit Test for the ring buffer with 32 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufSizeInvalid)
#else
static void testRingBufSizeInvalid(void)
#endif
{
RING_BUFFER test_buffer;
uint8_t data_element[16];
@@ -202,7 +214,11 @@ static void testRingBufSizeInvalid(void)
NULL);
}
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufPowerOfTwo)
#else
static void testRingBufPowerOfTwo(void)
#endif
{
zassert_equal(NEXT_POWER_OF_2(3), 4, NULL);
zassert_equal(NEXT_POWER_OF_2(100), 128, NULL);
@@ -318,7 +334,11 @@ static bool testRingBufNextElement(
/**
* Unit Test for the ring buffer with 16 data elements
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(ringbuf_tests, testRingBufNextElementSizeSmall)
#else
static void testRingBufNextElementSizeSmall(void)
#endif
{
bool status;
uint8_t data_element[5];
@@ -333,6 +353,9 @@ static void testRingBufNextElementSizeSmall(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(ringbuf_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(ringbuf_tests,
@@ -345,3 +368,4 @@ void test_main(void)
ztest_run_test_suite(ringbuf_tests);
}
#endif
+8
View File
@@ -19,7 +19,11 @@
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(sbuf_tests, testStaticBuffer)
#else
static void testStaticBuffer(void)
#endif
{
STATIC_BUFFER sbuffer;
char *data1 = "Joshua";
@@ -75,6 +79,9 @@ static void testStaticBuffer(void)
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(sbuf_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(sbuf_tests,
@@ -83,3 +90,4 @@ void test_main(void)
ztest_run_test_suite(sbuf_tests);
}
#endif