Files
LCUI/tests/fixtures/test_flex_layout.css
Liu faa7058837 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-05-24 17:56:23 +08:00

362 lines
5.0 KiB
CSS

text,
body {
font-size: 14px;
line-height: 1.6;
font-family: "Ubuntu Mono", "Consola";
}
scrollarea-content {
min-width: 0;
}
.example {
padding: 5px;
background-color: #f1f2f3;
border: 1px solid #ddd;
margin-bottom: 10px;
}
.container {
max-width: 600px;
width: 100%;
padding: 10px;
margin: 0 auto;
box-sizing: border-box;
}
.example__title {
padding: 5px;
font-size: 12px;
line-height: 22px;
}
.example__content {
padding: 5px;
background-color: #fff;
overflow: hidden;
}
.box {
width: 50px;
height: 50px;
background-color: #b8daff;
border: 1px solid #7cbbff;
box-sizing: border-box;
font-size: 12px;
line-height: 18px;
padding: 5px
}
.d-inline-block {
display: inline-block;
}
.d-flex {
display: flex;
}
.d-block {
display: block;
}
.ml-auto {
margin-left: auto;
}
.mr-auto {
margin-right: auto;
}
.ml-0 {
margin-left: 0;
}
.mr-0 {
margin-right: 0;
}
.w-auto {
width: auto;
}
.h-auto {
height: auto;
}
.h-full {
height: 100%;
}
.w-2 {
width: 100px;
}
.w-3 {
width: 150px;
}
.w-4 {
width: 200px;
}
.h-1 {
height: 50px;
}
.h-2 {
height: 100px;
}
.h-3 {
height: 150px;
}
.h-4 {
height: 200px;
}
.h-5 {
height: 250px;
}
.h-6 {
height: 300px;
}
.flex-1 {
flex: 1;
}
.flex-2 {
flex: 2;
}
.flex-4 {
flex: 4;
}
.flex-auto {
flex: auto;
}
.flex-none {
flex: none;
}
.flex-initial {
flex: initial;
}
.justify-content-center {
justify-content: center;
}
.justify-content-end {
justify-content: flex-end;
}
.justify-content-space-between {
justify-content: space-between;
}
.justify-content-space-around {
justify-content: space-around;
}
.felx-wrap {
flex-wrap: wrap;
}
.flex-direction-column {
flex-direction: column;
}
.align-items-center {
align-items: center;
}
.align-items-end {
align-items: flex-end;
}
.align-items-stretch {
align-items: stretch;
}
.example-1-flex-default .example__content {
display: flex;
}
.example-holy-grail-layout .example__content {
display: flex;
flex-direction: column;
}
.example-holy-grail-layout .box {
text-align: center;
}
.example-holy-grail-layout .layout__body {
display: flex;
flex: 1 1 auto;
}
.example-holy-grail-layout .layout__left,
.example-holy-grail-layout .layout__right {
width: 100px;
height: 100%;
flex: 0 0 auto;
}
.example-holy-grail-layout .layout__center {
flex: 1 1 auto;
height: 100%;
}
.example-browser .c-frame-tab__icon {
width: 16px;
flex: 0 0 auto;
line-height: 16px;
font-size: 16px;
margin-top: 2px;
text-align: center;
background-color: #b8daff;
border: 1px solid #7cbbff;
}
.example-browser .c-frame-tab__text {
flex: 1 1 auto;
height: 20px;
line-height: 20px;
margin: 0 8px 0 8px;
white-space: nowrap;
overflow: hidden;
font-size: 12px;
}
.example-browser .c-frame-tab__close {
flex: 0 0 auto;
width: 18px;
height: 18px;
font-size: 14px;
line-height: 18px;
text-align: center;
border-radius: 8px;
margin: 2px 0 0 auto;
}
.example-browser .c-frame-tab__close:hover {
background-color: #dee2e6;
}
.example-browser .c-frame-tab__close:active {
background-color: #ced4da;
}
.example-browser .c-frame-tab {
width: 100%;
min-width: 60px;
max-width: 25%;
position: relative;
margin-right: -1px;
padding: 8px;
display: flex;
box-sizing: border-box;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.example-browser .c-frame-tab:hover {
background-color: #e9ecef;
}
.example-browser .c-frame-tab.active {
background-color: #fff;
}
.example-browser .c-navbar {
display: flex;
padding: 5px 8px;
border-bottom: 1px solid #e9ecef;
line-height: 22px;
}
.example-browser .v-frame {
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
.example-browser .v-frame__navbar {
flex: 0 0 auto;
}
.example-browser .v-frame__client {
flex: 1 1 auto;
}
.example-browser .v-frame__content {
min-height: 100%;
box-sizing: border-box;
}
.example-browser .v-browser {
display: flex;
flex-direction: column;
height: 100%;
}
.example-browser .v-browser__tabbar {
display: flex;
flex: 0 0 auto;
align-items: flex-start;
background-color: #dee2e6;
padding: 8px 8px 0 8px;
}
.example-browser .v-browser__btn-add-tab {
width: 28px;
font-size: 18px;
line-height: 28px;
border-radius: 14px;
margin-left: 10px;
text-align: center;
margin-top: 4px;
flex: 0 0 auto;
}
.example-browser .c-navbar__input:hover {
background-color: #dee2e6;
}
.example-browser .c-navbar__input:focus {
border: 0;
background-color: #fff;
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.4);
}
.example-browser .v-browser__btn-add-tab:hover {
background-color: #ced4da;
}
.example-browser .v-browser__btn-add-tab:active {
background-color: #adb5bd;
}
.example-browser .v-home {
height: 100%;
display: flex;
align-items: center;
padding: 10px;
box-sizing: border-box;
}
.example-browser .v-home .container {
display: flex;
max-width: 256px;
width: 100%;
margin: 0 auto;
justify-content: center;
box-sizing: border-box;
}