acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

README.md (2257B)

      1 # Tests for LVGL
      2 
      3 The tests in the folder can be run locally and automatically by GitHub CI.
      4 
      5 ## Running locally
      6 
      7 ### Requirements (Linux)
      8 
      9 Install requirements by:
     10 
     11 ```sh
     12 scripts/install-prerequisites.sh
     13 ```
     14 
     15 ### Run test
     16 1. Run all executable tests with `./tests/main.py test`.
     17 2. Build all build-only tests with `./tests/main.py build`.
     18 3. Clean prior test build, build all build-only tests,
     19    run executable tests, and generate code coverage
     20    report `./tests/main.py --clean --report build test`.
     21 
     22 For full information on running tests run: `./tests/main.py --help`.
     23 
     24 ## Running automatically
     25 
     26 GitHub's CI automatically runs these tests on pushes and pull requests to `master` and `releasev8.*` branches.
     27 
     28 ## Directory structure
     29 - `src` Source files of the tests
     30     - `test_cases` The written tests,
     31     - `test_runners` Generated automatically from the files in `test_cases`.
     32     - other miscellaneous files and folders
     33 - `ref_imgs` - Reference images for screenshot compare
     34 - `report` - Coverage report. Generated if the `report` flag was passed to `./main.py`
     35 - `unity` Source files of the test engine
     36 
     37 ## Add new tests
     38 
     39 ### Create new test file
     40 New test needs to be added into the `src/test_cases` folder. The name of the files should look like `test_<name>.c`. The basic skeleton of a test file copy `_test_template.c`.
     41 
     42 ### Asserts
     43 See the list of asserts [here](https://github.com/ThrowTheSwitch/Unity/blob/master/docs/UnityAssertionsReference.md).
     44 
     45 There are some custom, LVGL specific asserts:
     46 - `TEST_ASSERT_EQUAL_SCREENSHOT("image1.png")` Render the active screen and compare its content with an image in the `ref_imgs` folder.
     47 If the compare fails `lvgl/test_screenshot_error.h` is created with the content of the frame buffer as an image.
     48 To see the that image `#include "test_screenshot_error.h"` and call `test_screenshot_error_show();`.
     49 - `TEST_ASSERT_EQUAL_COLOR(color1, color2)` Compare two colors.
     50 
     51 ### Adding new reference images
     52 The reference images can be taken by copy-pasting the test code in to LVGL simulator and saving the screen.
     53 LVGL needs to
     54 - 800x480 resolution
     55 - 32 bit color depth
     56 - `LV_USE_PERF_MONITOR` and `LV_USE_MEM_MONITOR` disabled
     57 - use the default theme, with the default color (don't set a theme manually)