mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
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.
160 lines
8.0 KiB
XML
160 lines
8.0 KiB
XML
<lcui-app>
|
|
<resource type="text/css" src="test_block_layout.css"/>
|
|
<ui>
|
|
<scrollarea class="h-full">
|
|
<scrollarea-content id="main">
|
|
<w class="container">
|
|
<w class="example">
|
|
<text class="example__title">(0) Basic</text>
|
|
<w class="example__content">
|
|
<w class="box w-auto"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box w-auto"></w>
|
|
<text class="box w-3">w-3</text>
|
|
<text class="box w-3 ml-auto">w-3 ml-auto</text>
|
|
<text class="box w-3 ml-auto mr-auto">w-3 ml-auto mr-auto</text>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block"></w>
|
|
</w>
|
|
</w>
|
|
<w class="example">
|
|
<text class="example__title">(1) Width</text>
|
|
<w class="example__content">
|
|
<text class="box w-min-50 d-inline-block">min-width: 50%; display: inline-block</text>
|
|
<text class="box w-50">width: 50%; display: block</text>
|
|
<text class="box w-100">width: 100%; display: block</text>
|
|
<text class="box w-50 d-inline-block">width: 50%; display: inline-block</text>
|
|
<text class="box w-50 d-inline-block">width: 50%; display: inline-block</text>
|
|
<text class="box w-25 d-inline-block">width: 25%; display: inline-block</text>
|
|
<text class="box w-25 d-inline-block">width: 25%; display: inline-block</text>
|
|
<text class="box w-25 d-inline-block">width: 25%; display: inline-block</text>
|
|
<text class="box w-25 d-inline-block">width: 25%; display: inline-block</text>
|
|
</w>
|
|
</w>
|
|
<w class="example">
|
|
<text class="example__title">(2) Auto size</text>
|
|
<w class="example__content">
|
|
<text id="test-text-auto-height" class="box h-auto w-4">block, limited width</text>
|
|
<text id="test-text-auto-size" class="box d-inline-block w-auto h-auto">inline block, auto size</text>
|
|
<text id="test-text-block-auto-height" class="box w-auto h-auto">block, auto size</text>
|
|
</w>
|
|
</w>
|
|
<w class="example">
|
|
<text class="example__title">(3) Margin</text>
|
|
<w class="example__content">
|
|
<w class="box-padding">
|
|
<text class="box w-auto m-2">margin: 16px</text>
|
|
<text class="box d-inline-block m-1">m-1</text>
|
|
<text class="box d-inline-block m-1">m-1</text>
|
|
<text class="box d-inline-block m-1">m-1</text>
|
|
<text class="box d-inline-block m-1">m-1</text>
|
|
<text class="box d-inline-block mr--2">mr--2</text>
|
|
<text class="box d-inline-block w-3 m-1">w-3 m-1</text>
|
|
<text class="box d-inline-block w-2 ml--2">w-2 ml--2</text>
|
|
<text class="box w-auto m--2">margin: -16px</text>
|
|
</w>
|
|
<w class="box-padding">
|
|
<text class="box w-auto">w-auto</text>
|
|
<text class="box w-auto ml--1">w-auto ml--1</text>
|
|
<text class="box w-auto ml--1 mr--1">w-auto ml--1 mr--1</text>
|
|
<text class="box w-4 ml--1 mr--1">width: 200px; margin-left: -8px; margin-right: -8px</text>
|
|
<text class="box w-100 ml--1 mr--1">width: 100%; margin-left: -8px; margin-right: -8px</text>
|
|
</w>
|
|
</w>
|
|
</w>
|
|
<w class="example">
|
|
<text class="example__title">(4) vertical-align</text>
|
|
<w class="example__content">
|
|
<w class="box d-inline-block"></w>
|
|
<w class="box d-inline-block h-2"></w>
|
|
<text class="box d-inline-block vertical-align-middle">middle</text>
|
|
<w class="box d-inline-block h-3"></w>
|
|
<text class="box d-inline-block vertical-align-bottom">bottom</text>
|
|
<w class="box d-inline-block h-2"></w>
|
|
<text class="box d-inline-block vertical-align-bottom">bottom</text>
|
|
<text class="box d-inline-block vertical-align-middle">middle</text>
|
|
<w class="box"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<text class="box d-inline-block vertical-align-middle">middle</text>
|
|
<text class="box d-inline-block vertical-align-bottom">bottom</text>
|
|
<w class="box d-inline-block h-2"></w>
|
|
<w class="box d-inline-block"></w>
|
|
<text class="box d-inline-block vertical-align-middle">middle</text>
|
|
<w class="box d-inline-block"></w>
|
|
</w>
|
|
</w>
|
|
<w class="example" id="example-position-absolute">
|
|
<text class="example__title">(5) position: absolute</text>
|
|
<w class="example__content">
|
|
<w id="box-absolute-top-left" class="box"></w>
|
|
<w id="box-absolute-top-right" class="box"></w>
|
|
<w id="box-absolute-bottom-left" class="box"></w>
|
|
<w id="box-absolute-bottom-right" class="box"></w>
|
|
<w id="box-absolute-center" class="box"></w>
|
|
</w>
|
|
</w>
|
|
<w class="example" id="example-dropdown-menu">
|
|
<text class="example__title">(6) Dropdown menu</text>
|
|
<w class="example__content">
|
|
<w class="dropdown-menu" id="test-dropdown-menu">
|
|
<text class="dropdown-item">Dropdown item text</text>
|
|
<text class="dropdown-item">Action</text>
|
|
<text class="dropdown-item">Another action</text>
|
|
<text class="dropdown-item">Something else here</text>
|
|
</w>
|
|
</w>
|
|
</w>
|
|
<w class="example" id="example-inline-block-nesting">
|
|
<text class="example__title">(7) Inline block nesting</text>
|
|
<w class="example__content">
|
|
<w id="example-inline-block-nesting__block-1">
|
|
<text class="box d-inline-block">inline-block > inline-block</text>
|
|
<text class="box d-inline-block">inline-block > inline-block</text>
|
|
<text class="box">inline-block > block</text>
|
|
<text class="box">inline-block > block</text>
|
|
</w>
|
|
<w id="example-inline-block-nesting__block-2">
|
|
<text class="box d-inline-block">absolute-position > inline-block</text>
|
|
<text class="box d-inline-block">absolute-position > inline-block</text>
|
|
<text class="box">absolute-position > block</text>
|
|
<text class="box">absolute-position > block</text>
|
|
</w>
|
|
</w>
|
|
</w>
|
|
<w class="example" id="example-progress-bar">
|
|
<text class="example__title">(5) Absolutely positioned progress bar</text>
|
|
<w class="example__content">
|
|
<w class="message-box">
|
|
<text>loading...</text>
|
|
<w class="progress">
|
|
<w class="progress-bar" id="example-progress-bar__bar"></w>
|
|
</w>
|
|
</w>
|
|
</w>
|
|
</w>
|
|
</w>
|
|
</scrollarea-content>
|
|
<scrollbar />
|
|
</scrollarea>
|
|
</ui>
|
|
</lcui-app>
|