This commit is contained in:
2026-02-13 14:42:07 -08:00
parent df0527b123
commit fbc02af589
670 changed files with 55968 additions and 51275 deletions

View File

@@ -334,7 +334,6 @@ add_library(test_common
src/test_fonts/font_1.c
src/test_fonts/font_2.c
src/test_fonts/font_3.c
src/test_fonts/ubuntu_font.c
unity/unity_support.c
unity/unity.c
)
@@ -364,7 +363,7 @@ foreach( test_case_fname ${TEST_CASE_FILES} )
${test_case_fname}
${test_runner_fname}
)
target_link_libraries(${test_name} test_common lvgl_examples lvgl_demos lvgl png m ${TEST_LIBS})
target_link_libraries(${test_name} test_common lvgl_examples lvgl_demos lvgl png ${TEST_LIBS})
target_include_directories(${test_name} PUBLIC ${TEST_INCLUDE_DIRS})
target_compile_options(${test_name} PUBLIC ${LVGL_TESTFILE_COMPILE_OPTIONS})

0
libraries/lvgl/tests/main.py Executable file → Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -20,8 +20,6 @@ extern "C" {
* DEFINES
*********************/
#define LV_USE_TINY_TTF 1
void lv_test_assert_fail(void);
#define LV_ASSERT_HANDLER lv_test_assert_fail();

View File

@@ -158,53 +158,6 @@ void test_arc_click_area_with_adv_hittest(void)
TEST_ASSERT_EQUAL_UINT32(0, event_cnt);
}
/* Check value doesn't go to max when clicking on the other side of the arc */
void test_arc_click_sustained_from_start_to_end_does_not_set_value_to_max(void)
{
arc = lv_arc_create(lv_scr_act());
lv_arc_set_value(arc, 0);
lv_obj_set_size(arc, 100, 100);
lv_obj_center(arc);
lv_obj_add_event_cb(arc, dummy_event_cb, LV_EVENT_PRESSED, NULL);
event_cnt = 0;
/* Click close to start angle */
event_cnt = 0;
lv_test_mouse_move_to(376, 285);
lv_test_mouse_press();
lv_test_indev_wait(50);
lv_test_mouse_release();
lv_test_indev_wait(50);
TEST_ASSERT_EQUAL_UINT32(1, event_cnt);
TEST_ASSERT_EQUAL_UINT32(lv_arc_get_value(arc), lv_arc_get_min_value(arc));
/* Click close to end angle */
event_cnt = 0;
lv_test_mouse_move_to(376, 285);
lv_test_mouse_press();
lv_test_indev_wait(50);
lv_test_mouse_move_to(415, 281);
lv_test_indev_wait(50);
lv_test_mouse_release();
lv_test_indev_wait(50);
TEST_ASSERT_EQUAL_UINT32(1, event_cnt);
TEST_ASSERT_NOT_EQUAL_UINT32(lv_arc_get_value(arc), lv_arc_get_max_value(arc));
TEST_ASSERT_EQUAL_SCREENSHOT("arc_2.png");
}
void test_arc_basic_render(void)
{
arc = lv_arc_create(lv_scr_act());
lv_obj_set_size(arc, 100, 100);
lv_obj_center(arc);
TEST_ASSERT_EQUAL_SCREENSHOT("arc_1.png");
}
static void dummy_event_cb(lv_event_t * e)
{
LV_UNUSED(e);

View File

@@ -1,49 +0,0 @@
#if LV_BUILD_TEST
#include "../lvgl.h"
#include "unity/unity.h"
void setUp(void)
{
/* Function run before every test */
}
void tearDown(void)
{
/* Function run after every test */
}
void test_tiny_ttf_rendering_test(void)
{
#if LV_USE_TINY_TTF
/*Create a font*/
extern const uint8_t ubuntu_font[];
extern size_t ubuntu_font_size;
lv_font_t * font = lv_tiny_ttf_create_data(ubuntu_font, ubuntu_font_size, 30);
/*Create style with the new font*/
static lv_style_t style;
lv_style_init(&style);
lv_style_set_text_font(&style, font);
lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER);
lv_style_set_bg_opa(&style, LV_OPA_COVER);
lv_style_set_bg_color(&style, lv_color_hex(0xffaaaa));
/*Create a label with the new style*/
lv_obj_t * label = lv_label_create(lv_scr_act());
lv_obj_add_style(label, &style, 0);
lv_label_set_text(label, "Hello world\n"
"I'm a font created with Tiny TTF\n"
"Accents: ÁÉÍÓÖŐÜŰ áéíóöőüű");
lv_obj_center(label);
TEST_ASSERT_EQUAL_SCREENSHOT("tiny_ttf_1.png");
lv_obj_del(label);
lv_tiny_ttf_destroy(font);
#else
TEST_PASS();
#endif
}
#endif

File diff suppressed because it is too large Load Diff