5 Commits
Author SHA1 Message Date
Liu 64cfdc477c test: use tailwind-style labels in flex layout fixtures
Replace prose CSS declarations with short tailwind utility names so example titles stay on one line and remain readable at narrow widths.
2026-11-20 00:22:14 +08:00
Liu 74255f501c test: shorten flex layout titles to avoid font-dependent wrapping
The example 10/12 titles were long enough to wrap at 320px, so their container height depended on the resolved monospace font. Use short tailwind-style labels, expect the single-line height, and drop the bundled DejaVu Sans Mono fixture.
2026-11-20 00:00:29 +08:00
Liu b5e6bbf1c3 test(ui): add choice card reflow stability test and document event handler signature 2026-10-17 21:16:35 +08:00
Liu 65022e9437 test(flex-layout): add gap example to preview fixture
Add a new "(18) gap" example block in tests/fixtures/test_flex_layout.xml
that exercises the gap shorthand and longhand variants:

- gap: 10px
- gap: 10px 5px with flex-wrap: wrap
- row-gap: 10px with flex-direction: column
- column-gap: 10px with justify-content: space-between

Define the corresponding utility classes (.gap-2, .gap-2-1, .row-gap-2,
.column-gap-2) in test_flex_layout.css so the example renders in
`xmake run preview-flex-layout`. The new block is appended after the
existing Browser Layout example to preserve the indices used by the
flex-layout integration tests.
2026-08-05 22:41:31 +08:00
Liu 75dbca815d test: reorganize test suite with xmake test integration
Restructure the test infrastructure with these changes:

* Extend libctest with ctest_suite_t, ctest_parse_args, ctest_run_suites and CTEST_MAIN macro to standardize test entry points; support --grep / --grep= / --list / --interactive flags; add ctest-tests for self-tests.

* Regroup tests by lib boundary: sink unit tests into lib/<name>/tests/ with <lib>_<topic> entry function names, move fixtures into lib/<name>/tests/fixtures/, rename top-level tests/cases/ to tests/integration/ for cross-lib integration tests.

* Add tests/scenes/ for reusable widget tree builders shared by integration cases and visual preview binaries; add tests/previews/ with 4 diagnostic binaries (flex_layout, block_layout, widget_opacity, scrollbar).

* Rewrite all describe/equal description strings using 'should ...' style or noun topic names; drop redundant lcui_quit/lcui_main calls from integration cases.

* Integrate xmake test via add_tests(\default\) and a shared tests.runnable rule defined in the root xmake.lua; the rule wraps the test binary with drmemory (Windows) or valgrind (Linux) when option memcheck=y.

* Drop the lcui-tests aggregation: lcui-tests now contains only integration cases and scenes, not the union of lib tests. Use xmake test to run everything across libs.

* Fix .clang-format: InsertNewlineAtEndOfFile -> InsertNewlineAtEOF (correct key for clang-format 16+).

* Update AGENTS.md with the new test layout, naming rules, description style and run commands.

* Update CI to use xmake test and xmake f --memcheck=y instead of per-lib runs.
2026-08-05 22:41:12 +08:00