tui: revive example

This commit is contained in:
🪞👃🪞 2025-09-07 21:28:47 +03:00
parent 5e6338fad8
commit baa582b9dd
2 changed files with 22 additions and 9 deletions

View file

@ -1,17 +1,29 @@
covfig := "CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' RUSTDOCFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cov/cargo-test-%p-%m.profraw'" export LLVM_PROFILE_FILE := "cov/cargo-test-%p-%m.profraw"
grcov-binary := "--binary-path ./target/coverage/deps/" grcov-binary := "--binary-path ./target/coverage/deps/"
grcov-ignore := "--ignore-not-existing --ignore '../*' --ignore \"/*\" --ignore 'target/*'" grcov-ignore := "--ignore-not-existing --ignore '../*' --ignore \"/*\" --ignore 'target/*'"
bacon: bacon:
{{covfig}} bacon -s bacon -s
cov: cov:
{{covfig}} time cargo test -j4 --workspace --profile coverage CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' \
time cargo test -j4 --workspace --profile coverage
rm -rf target/coverage/html || true rm -rf target/coverage/html || true
{{covfig}} time grcov . -s . {{grcov-binary}} {{grcov-ignore}} -t html -o target/coverage/html time grcov . -s . {{grcov-binary}} {{grcov-ignore}} -t html -o target/coverage/html
cov-md: cov-md:
{{covfig}} time cargo test -j4 --workspace --profile coverage CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' \
{{covfig}} time grcov . -s . {{grcov-binary}} {{grcov-ignore}} -t markdown | sort time cargo test -j4 --workspace --profile coverage
time grcov . -s . {{grcov-binary}} {{grcov-ignore}} -t markdown | sort
cov-md-ci: cov-md-ci:
{{covfig}} time cargo test -j4 --workspace --profile coverage -- --skip test_tui_engine CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' \
{{covfig}} time grcov . -s . {{grcov-binary}} {{grcov-ignore}} -t markdown | sort time cargo test -j4 --workspace --profile coverage -- --skip test_tui_engine
time grcov . -s . {{grcov-binary}} {{grcov-ignore}} -t markdown | sort
doc: doc:
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' RUSTDOCFLAGS='-Cinstrument-coverage' \
cargo doc cargo doc
example-tui:
cargo run -p tengri_tui --example tui

View file

@ -63,6 +63,7 @@ impl ExampleCommand {
} }
} }
tui_draw!(|self: Example, to|to.place(&self.content()));
content!(TuiOut: |self: Example|{ content!(TuiOut: |self: Example|{
let index = self.0 + 1; let index = self.0 + 1;
let wh = self.1.wh(); let wh = self.1.wh();