From dd27c3530432ea0b09f01e604bf577f31d8ef841 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 1 Jun 2023 15:41:47 +1000 Subject: convert lvgl from submodule to a plain old directory --- lib/lvgl | 1 - lib/lvgl/tests/unity/unity_support.h | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) delete mode 160000 lib/lvgl create mode 100644 lib/lvgl/tests/unity/unity_support.h (limited to 'lib/lvgl/tests/unity/unity_support.h') diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 index 0732400e..00000000 --- a/lib/lvgl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0732400e7b564dd0e7dc4a924619d8e19c5b23a0 diff --git a/lib/lvgl/tests/unity/unity_support.h b/lib/lvgl/tests/unity/unity_support.h new file mode 100644 index 00000000..0d30cee1 --- /dev/null +++ b/lib/lvgl/tests/unity/unity_support.h @@ -0,0 +1,42 @@ + +#ifndef LV_UNITY_SUPPORT_H +#define LV_UNITY_SUPPORT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "../../lvgl.h" + +bool lv_test_assert_img_eq(const char * fn_ref); + + +#if LV_COLOR_DEPTH != 32 +# define TEST_ASSERT_EQUAL_SCREENSHOT(path) TEST_IGNORE_MESSAGE("Requires LV_COLOR_DEPTH 32"); +# define TEST_ASSERT_EQUAL_SCREENSHOT_MESSAGE(path, msg) TEST_PRINTF(msg); TEST_IGNORE_MESSAGE("Requires LV_COLOR_DEPTH 32"); +#else + +# define TEST_ASSERT_EQUAL_SCREENSHOT(path) if(LV_HOR_RES != 800 || LV_VER_RES != 480) { \ + TEST_IGNORE_MESSAGE("Requires 800x480 resolution"); \ + } else { \ + TEST_ASSERT(lv_test_assert_img_eq(path)); \ + } + +# define TEST_ASSERT_EQUAL_SCREENSHOT_MESSAGE(path, msg) if(LV_HOR_RES != 800 || LV_VER_RES != 480) { \ + TEST_PRINTF(msg); \ + TEST_IGNORE_MESSAGE("Requires 800x480 resolution"); \ + } else { \ + TEST_ASSERT_MESSAGE(lv_test_assert_img_eq(path), msg); \ + } +#endif + +# define TEST_ASSERT_EQUAL_COLOR(c1, c2) TEST_ASSERT_EQUAL_UINT32(c1.full, c2.full) +# define TEST_ASSERT_EQUAL_COLOR_MESSAGE(c1, c2, msg) TEST_ASSERT_EQUAL_UINT32_MESSAGE(c1.full, c2.full, msg) + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_UNITY_SUPPORT_H*/ + -- cgit v1.2.3