lv_xml_test.h

Enums

enum lv_xml_test_step_type_t

Values:

enumerator LV_XML_TEST_STEP_TYPE_NONE
enumerator LV_XML_TEST_STEP_TYPE_MOVE_TO
enumerator LV_XML_TEST_STEP_TYPE_PRESS
enumerator LV_XML_TEST_STEP_TYPE_RELEASE
enumerator LV_XML_TEST_STEP_TYPE_CLICK_AT
enumerator LV_XML_TEST_STEP_TYPE_WAIT
enumerator LV_XML_TEST_STEP_TYPE_FREEZE
enumerator LV_XML_TEST_STEP_TYPE_SCREENSHOT_COMPARE
enumerator LV_XML_TEST_STEP_TYPE_SUBJECT_SET
enumerator LV_XML_TEST_STEP_TYPE_SUBJECT_COMPARE

Functions

lv_result_t lv_xml_test_register_from_data(const char *xml_def, const char *ref_image_path_prefix)

Load the styles, constants, another data of the test. It needs to be called only once for each test.

Parameters:
  • xml_def – the XML definition of the test as a NULL terminated string

  • ref_image_path_prefix – prefix for the path of reference images

Returns:

LV_RES_OK: loaded successfully, LV_RES_INVALID: otherwise

lv_result_t lv_xml_test_register_from_file(const char *path, const char *ref_image_path_prefix)

Load the styles, constants, another data of the test. It needs to be called only once for each test.

Parameters:
  • path – path to an XML file

  • ref_image_path_prefix – prefix for the path of reference images

Returns:

LV_RES_OK: loaded successfully, LV_RES_INVALID: otherwise

void lv_xml_test_unregister(void)

Free resources allocated for testing.

void lv_xml_test_run_init(void)

Switch to testing mode. Needs to be called to use lv_xml_test_run_next()

bool lv_xml_test_run_next(uint32_t slowdown)

Run the next test step.

Parameters:

slowdown – 0: max speed, 1: real speed, 2: half speed, ... ,10: ten times slower

Returns:

true: the step passed; false: the step failed

void lv_xml_test_run_stop(void)

Leave testing mode.

uint32_t lv_xml_test_run_all(uint32_t slowdown)

Run all the test steps. It calls lv_xml_test_run_init(), lv_xml_test_run_next(), and lv_xml_test_run_stop internally so no further preparation or cleanup is needed.

Parameters:

slowdown – 0: max speed, 1: real speed, 2: half speed, ... ,10: ten times slower

Returns:

number of failed tests

uint32_t lv_xml_test_get_step_count(void)

Get the number of steps in a test

Returns:

the number of <step>s

lv_xml_test_step_type_t lv_xml_test_get_step_type(uint32_t idx)

Get the type of a step

Parameters:

idx – the index of a step (< step_count)

Returns:

element of lv_xml_test_step_type_t

bool lv_xml_test_get_status(uint32_t idx)

Check if the a step was passed. Can be called after lv_xml_test_run()

Parameters:

idx – the index of a step (< step_count)

Returns:

true: the step passed, false: the step failed