Build and Test the Simulator

The simulator displays the U8g2 framebuffer through Qt6. It is the fastest way to visually check App, Widget, and animation changes.

Prerequisites

1
git submodule update --init --recursive

You need CMake, a C++20 compiler, and Qt6 Core, Gui, and Widgets. If CMake cannot find Qt, provide its prefix explicitly:

1
2
3
4
cmake -S . -B build \
-DBUILD_SIMULATOR=ON \
-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt
cmake --build build -j

Run the simulator with:

1
./build/simulator/u8g2_emulator

Regression tests

1
ctest --test-dir build --output-on-failure

Current tests cover App arena and ViewManager lifecycle, Chart buffers, inline Animation storage, the Popup pool, PopupValueDigits, FocusManager migration, and the Widget tree.

AddressSanitizer

1
2
3
4
5
6
cmake -S . -B build-asan \
-DBUILD_SIMULATOR=ON \
-DENABLE_ASAN=ON \
-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt
cmake --build build-asan -j
ctest --test-dir build-asan --output-on-failure

ASan is particularly useful for finding Widget, callback, or Animation references to destroyed App members.

Memory report

1
./build/tests/memory_metrics

sizeof results apply only to the current compiler, ABI, and configuration. Measure again after porting to an MCU and inspect the linker map for RAM and flash use.

Minimum pre-commit checks

1
2
3
git diff --check
rg -n "std::|#include <(vector|string|memory|functional|map|queue)>" \
include src examples tests

The second command is a quick scan. Keep the simulator’s Qt/STL boundary separate from PixelUI core findings.

最新文章
网站信息
文章数目 :
1
本站访客数 :
本站总浏览量 :
最后更新时间 :