Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ab822940e |
@@ -79,6 +79,7 @@ cargo test -p alkane-gui --release -- --ignored bench_ # microbenchmarks
|
|||||||
cargo clippy -p alkane-gui --no-deps --bins -- -D warnings # lint gate
|
cargo clippy -p alkane-gui --no-deps --bins -- -D warnings # lint gate
|
||||||
xvfb-run -a env ALKANE_SELFTEST=1 \
|
xvfb-run -a env ALKANE_SELFTEST=1 \
|
||||||
"$CARGO_TARGET_DIR/release/alkane-toolkit" # headless UI self-test
|
"$CARGO_TARGET_DIR/release/alkane-toolkit" # headless UI self-test
|
||||||
|
ci/coverage.sh --summary-only # coverage (tests + self-test)
|
||||||
```
|
```
|
||||||
|
|
||||||
CI mirrors these: `verify.yml` runs the lint, tests, benchmarks, self-test, and
|
CI mirrors these: `verify.yml` runs the lint, tests, benchmarks, self-test, and
|
||||||
|
|||||||
+5
-5
@@ -1,5 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="95.5" height="20" role="img" aria-label="coverage: 35%">
|
<svg xmlns="http://www.w3.org/2000/svg" width="95.5" height="20" role="img" aria-label="coverage: 46%">
|
||||||
<title>coverage: 35%</title>
|
<title>coverage: 46%</title>
|
||||||
<linearGradient id="s" x2="0" y2="100%">
|
<linearGradient id="s" x2="0" y2="100%">
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
@@ -7,13 +7,13 @@
|
|||||||
<clipPath id="r"><rect width="95.5" height="20" rx="3" fill="#fff"/></clipPath>
|
<clipPath id="r"><rect width="95.5" height="20" rx="3" fill="#fff"/></clipPath>
|
||||||
<g clip-path="url(#r)">
|
<g clip-path="url(#r)">
|
||||||
<rect width="64.0" height="20" fill="#555"/>
|
<rect width="64.0" height="20" fill="#555"/>
|
||||||
<rect x="64.0" width="31.5" height="20" fill="#fe7d37"/>
|
<rect x="64.0" width="31.5" height="20" fill="#dfb317"/>
|
||||||
<rect width="95.5" height="20" fill="url(#s)"/>
|
<rect width="95.5" height="20" fill="url(#s)"/>
|
||||||
</g>
|
</g>
|
||||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||||
<text x="32.0" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
<text x="32.0" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
||||||
<text x="32.0" y="14">coverage</text>
|
<text x="32.0" y="14">coverage</text>
|
||||||
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">35%</text>
|
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">46%</text>
|
||||||
<text x="79.8" y="14">35%</text>
|
<text x="79.8" y="14">46%</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
@@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Measure line coverage from BOTH the unit tests AND the headless UI self-test.
|
||||||
|
#
|
||||||
|
# The self-test (ALKANE_SELFTEST=1) builds the real wxWidgets table, renders every
|
||||||
|
# fixture through the real widgets, and checks each cell against the model -- it
|
||||||
|
# exercises most of ui.rs. Because it runs as a separate binary invocation, a plain
|
||||||
|
# `cargo llvm-cov` (which only runs the #[test]s) never counts it, so ui.rs shows
|
||||||
|
# ~4% even though it is integration-tested. This combines both runs' coverage.
|
||||||
|
#
|
||||||
|
# Usage: ci/coverage.sh [extra `cargo llvm-cov report` args, e.g. --summary-only]
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
export WX_RS_WXCONFIG="${WX_RS_WXCONFIG:-$HOME/.cache/wx-3.3.3-linux/bin/wx-config}"
|
||||||
|
|
||||||
|
# A display for the self-test's real widgets.
|
||||||
|
need_xvfb() { command -v xvfb-run >/dev/null 2>&1; }
|
||||||
|
|
||||||
|
cargo llvm-cov clean --workspace
|
||||||
|
|
||||||
|
# 1. Unit tests.
|
||||||
|
cargo llvm-cov --no-report -p alkane-gui --bin alkane-toolkit
|
||||||
|
|
||||||
|
# 2. Headless UI self-test, under the same instrumentation, its coverage appended.
|
||||||
|
if need_xvfb; then
|
||||||
|
xvfb-run -a env GDK_BACKEND=x11 ALKANE_SELFTEST=1 \
|
||||||
|
cargo llvm-cov run --no-report --bin alkane-toolkit
|
||||||
|
else
|
||||||
|
echo "coverage.sh: xvfb-run not found; skipping the self-test run (unit tests only)" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Merged report, our source only (vendored asic-rs + the patched wx-rs bridge
|
||||||
|
# are out of scope).
|
||||||
|
cargo llvm-cov report --ignore-filename-regex '(thirdparty|vendor)/' "$@"
|
||||||
Reference in New Issue
Block a user