mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-22 12:15:55 +08:00
* Captures on Linux: portal, PipeWire and VA-API behind the engine's platform seam; capture compiled into macOS and Linux builds The capture engine's OS adapter gains capture/linux.rs: the screen-cast portal (zbus) picks the screen (remembered with its restore token) or a window, libpipewire and libva are loaded at run time, frames are imported as DMA-BUFs and scaled and H.264-encoded on the GPU, and ffmpeg muxes and reads movies back. Software x264 is the fallback. capture_host, the capsule, the pane, routing and the CLI are shared; the Linux listener feeds a ListenerTimeline, its portal or X11 grabs bind the capture shortcut, and the summary goes through Hex's Linux clipboard. The capture feature flag is gone: macOS and Linux always compile the experiment, off by default. * Docs: captures on Linux, the experiment in every macOS and Linux build; token path from Hex * Capture portal: register Hex's app id so the desktop keeps its screen choice * Fix macOS test build after the capture seam * Linux: size X11 shortcut state for the capture shortcut; keep macOS-layout capsule tests on macOS * Windows: the capture word timestamps field is Linux's
45 lines
1.6 KiB
Bash
Executable File
45 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# The local check loop.
|
|
#
|
|
# scripts/check fmt, clippy, then every test
|
|
# scripts/check meeting::query fmt, then only the tests matching the filters
|
|
#
|
|
# Tests run through cargo-nextest (.config/nextest.toml): each test is its own
|
|
# process, and one that hangs is killed and reported by name. Exit codes:
|
|
# 10 fmt, 11 clippy, 12 tests. NEXTEST_PROFILE=ci selects CI's profile.
|
|
# Tests build with the `capture` feature, so the debug-only capture
|
|
# experiment's code (macOS) is tested too. `crates/capture` and
|
|
# `crates/capture-core` sit outside the workspace (Cargo.toml), so on macOS
|
|
# they are named to be linted and tested.
|
|
set -uo pipefail
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
|
|
|
packages=(--workspace)
|
|
if [[ "$(uname -s)" == Darwin ]]; then
|
|
# zbus depends on the crates.io `hex`, so the root package is named by its ID.
|
|
packages=(-p "$(cargo pkgid)" -p scrawl-router -p scrawl-capture -p capture-core)
|
|
fi
|
|
|
|
stage() {
|
|
printf '\n==> %s\n' "$1"
|
|
}
|
|
|
|
stage "fmt"
|
|
cargo fmt --all --check || exit 10
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
stage "clippy"
|
|
cargo clippy --locked "${packages[@]}" --all-targets --features onnx-benchmark -- -D warnings || exit 11
|
|
fi
|
|
|
|
if command -v cargo-nextest >/dev/null 2>&1; then
|
|
stage "test (nextest${1:+: $*})"
|
|
cargo nextest run --locked "${packages[@]}" --no-tests=warn "$@" || exit 12
|
|
else
|
|
stage "test (cargo test${1:+: $*})"
|
|
echo "cargo-nextest is not installed, so a hung test stalls the run without" >&2
|
|
echo "a name. Install it with: brew install cargo-nextest" >&2
|
|
cargo test --locked "${packages[@]}" -- "$@" || exit 12
|
|
fi
|