From e2a98e1b8af156988ad0ac778658ac27b60a55fb Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 10 Oct 2026 08:37:27 +0100 Subject: [PATCH] escape-parser: Fix no_std build and add CI coverage Fix `make test` failing on the wezterm-escape-parser no_std configuration, and add CI coverage to prevent silent regressions. --- .github/workflows/gen_centos9.yml | 3 +++ .github/workflows/gen_centos9_continuous.yml | 3 +++ .github/workflows/gen_centos9_tag.yml | 3 +++ .github/workflows/gen_debian12.yml | 3 +++ .github/workflows/gen_debian12_continuous.yml | 3 +++ .github/workflows/gen_debian12_tag.yml | 3 +++ .github/workflows/gen_fedora41.yml | 3 +++ .github/workflows/gen_fedora41_continuous.yml | 3 +++ .github/workflows/gen_fedora41_tag.yml | 3 +++ .github/workflows/gen_macos.yml | 3 +++ .github/workflows/gen_macos_continuous.yml | 3 +++ .github/workflows/gen_macos_tag.yml | 3 +++ .github/workflows/gen_ubuntu22.04.yml | 3 +++ .github/workflows/gen_ubuntu22.04_continuous.yml | 3 +++ .github/workflows/gen_ubuntu22.04_tag.yml | 3 +++ .github/workflows/gen_ubuntu24.04.yml | 3 +++ .github/workflows/gen_ubuntu24.04_continuous.yml | 3 +++ .github/workflows/gen_ubuntu24.04_tag.yml | 3 +++ .github/workflows/gen_ubuntu26.04.yml | 3 +++ .github/workflows/gen_ubuntu26.04_continuous.yml | 3 +++ .github/workflows/gen_ubuntu26.04_tag.yml | 3 +++ ci/generate-workflows.py | 16 ++++++++++++---- wezterm-escape-parser/src/apc.rs | 2 ++ wezterm-escape-parser/src/esc.rs | 2 ++ wezterm-escape-parser/src/parser/sixel.rs | 2 ++ 25 files changed, 81 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gen_centos9.yml b/.github/workflows/gen_centos9.yml index bc6754b44..5df721865 100644 --- a/.github/workflows/gen_centos9.yml +++ b/.github/workflows/gen_centos9.yml @@ -97,6 +97,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_centos9_continuous.yml b/.github/workflows/gen_centos9_continuous.yml index 8d73db61e..39302e601 100644 --- a/.github/workflows/gen_centos9_continuous.yml +++ b/.github/workflows/gen_centos9_continuous.yml @@ -100,6 +100,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_centos9_tag.yml b/.github/workflows/gen_centos9_tag.yml index 01184d7cf..ece8ee649 100644 --- a/.github/workflows/gen_centos9_tag.yml +++ b/.github/workflows/gen_centos9_tag.yml @@ -79,6 +79,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_debian12.yml b/.github/workflows/gen_debian12.yml index f354c058d..113942d2b 100644 --- a/.github/workflows/gen_debian12.yml +++ b/.github/workflows/gen_debian12.yml @@ -100,6 +100,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_debian12_continuous.yml b/.github/workflows/gen_debian12_continuous.yml index 400db13b2..9618d3dd8 100644 --- a/.github/workflows/gen_debian12_continuous.yml +++ b/.github/workflows/gen_debian12_continuous.yml @@ -103,6 +103,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_debian12_tag.yml b/.github/workflows/gen_debian12_tag.yml index 0a6c45299..3f41f7ecc 100644 --- a/.github/workflows/gen_debian12_tag.yml +++ b/.github/workflows/gen_debian12_tag.yml @@ -82,6 +82,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_fedora41.yml b/.github/workflows/gen_fedora41.yml index ee436d28d..dfc6b2a76 100644 --- a/.github/workflows/gen_fedora41.yml +++ b/.github/workflows/gen_fedora41.yml @@ -94,6 +94,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_fedora41_continuous.yml b/.github/workflows/gen_fedora41_continuous.yml index efbf928a1..2553ec238 100644 --- a/.github/workflows/gen_fedora41_continuous.yml +++ b/.github/workflows/gen_fedora41_continuous.yml @@ -97,6 +97,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_fedora41_tag.yml b/.github/workflows/gen_fedora41_tag.yml index fc17f9d88..1c144e115 100644 --- a/.github/workflows/gen_fedora41_tag.yml +++ b/.github/workflows/gen_fedora41_tag.yml @@ -76,6 +76,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_macos.yml b/.github/workflows/gen_macos.yml index ed9d74eee..412139159 100644 --- a/.github/workflows/gen_macos.yml +++ b/.github/workflows/gen_macos.yml @@ -88,6 +88,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast --target=x86_64-apple-darwin" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser --target=x86_64-apple-darwin" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_macos_continuous.yml b/.github/workflows/gen_macos_continuous.yml index bda7b4521..6957dbe32 100644 --- a/.github/workflows/gen_macos_continuous.yml +++ b/.github/workflows/gen_macos_continuous.yml @@ -91,6 +91,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast --target=x86_64-apple-darwin" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser --target=x86_64-apple-darwin" - name: "Package" env: MACOS_APPLEID: ${{ secrets.MACOS_APPLEID }} diff --git a/.github/workflows/gen_macos_tag.yml b/.github/workflows/gen_macos_tag.yml index c635bf8bd..6950946d1 100644 --- a/.github/workflows/gen_macos_tag.yml +++ b/.github/workflows/gen_macos_tag.yml @@ -75,6 +75,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast --target=x86_64-apple-darwin" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser --target=x86_64-apple-darwin" - name: "Package" env: MACOS_APPLEID: ${{ secrets.MACOS_APPLEID }} diff --git a/.github/workflows/gen_ubuntu22.04.yml b/.github/workflows/gen_ubuntu22.04.yml index 800a8868d..0445ff01a 100644 --- a/.github/workflows/gen_ubuntu22.04.yml +++ b/.github/workflows/gen_ubuntu22.04.yml @@ -100,6 +100,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu22.04_continuous.yml b/.github/workflows/gen_ubuntu22.04_continuous.yml index a46819981..7db3268b5 100644 --- a/.github/workflows/gen_ubuntu22.04_continuous.yml +++ b/.github/workflows/gen_ubuntu22.04_continuous.yml @@ -103,6 +103,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu22.04_tag.yml b/.github/workflows/gen_ubuntu22.04_tag.yml index 6f4f8484f..aa962b201 100644 --- a/.github/workflows/gen_ubuntu22.04_tag.yml +++ b/.github/workflows/gen_ubuntu22.04_tag.yml @@ -82,6 +82,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu24.04.yml b/.github/workflows/gen_ubuntu24.04.yml index 46db8577e..c14aed116 100644 --- a/.github/workflows/gen_ubuntu24.04.yml +++ b/.github/workflows/gen_ubuntu24.04.yml @@ -100,6 +100,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu24.04_continuous.yml b/.github/workflows/gen_ubuntu24.04_continuous.yml index d6c537071..1997a227c 100644 --- a/.github/workflows/gen_ubuntu24.04_continuous.yml +++ b/.github/workflows/gen_ubuntu24.04_continuous.yml @@ -103,6 +103,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu24.04_tag.yml b/.github/workflows/gen_ubuntu24.04_tag.yml index 1d3b9ea20..9ceaf5c93 100644 --- a/.github/workflows/gen_ubuntu24.04_tag.yml +++ b/.github/workflows/gen_ubuntu24.04_tag.yml @@ -82,6 +82,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu26.04.yml b/.github/workflows/gen_ubuntu26.04.yml index 4cba90e2d..b1a9198b4 100644 --- a/.github/workflows/gen_ubuntu26.04.yml +++ b/.github/workflows/gen_ubuntu26.04.yml @@ -105,6 +105,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu26.04_continuous.yml b/.github/workflows/gen_ubuntu26.04_continuous.yml index d34ffb70a..e21676078 100644 --- a/.github/workflows/gen_ubuntu26.04_continuous.yml +++ b/.github/workflows/gen_ubuntu26.04_continuous.yml @@ -108,6 +108,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/.github/workflows/gen_ubuntu26.04_tag.yml b/.github/workflows/gen_ubuntu26.04_tag.yml index 32dd5e7c4..4ce8a0900 100644 --- a/.github/workflows/gen_ubuntu26.04_tag.yml +++ b/.github/workflows/gen_ubuntu26.04_tag.yml @@ -84,6 +84,9 @@ jobs: - name: "Test" shell: bash run: "cargo nextest run --all --no-fail-fast" + - name: "Test wezterm-escape-parser (no_std)" + shell: bash + run: "cargo nextest run -p wezterm-escape-parser" - name: "Package" shell: bash run: "bash ci/deploy.sh" diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index 0ec37b60f..b895df059 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -477,12 +477,15 @@ rustup default {toolchain} return steps def test_all(self): - run = "cargo nextest run --all --no-fail-fast" + target = "" if "macos" in self.name: - run += " --target=x86_64-apple-darwin" + target = " --target=x86_64-apple-darwin" + prefix = "" if self.name == "centos7": - run = "source /opt/rh/devtoolset-9/enable\n" + run - return [ + prefix = "source /opt/rh/devtoolset-9/enable\n" + run = prefix + "cargo nextest run --all --no-fail-fast" + target + run_no_std = prefix + "cargo nextest run -p wezterm-escape-parser" + target + steps = [ # Install cargo-nextest InstallCrateStep("cargo-nextest", key=self.name), # Run tests @@ -490,6 +493,11 @@ rustup default {toolchain} if "win" in self.name else RunStep(name="Test", run=run), ] + if "win" not in self.name: + steps += [ + RunStep(name="Test wezterm-escape-parser (no_std)", run=run_no_std) + ] + return steps def package(self, trusted=False): steps = [] diff --git a/wezterm-escape-parser/src/apc.rs b/wezterm-escape-parser/src/apc.rs index 3bf592ba3..ddf4a33b1 100644 --- a/wezterm-escape-parser/src/apc.rs +++ b/wezterm-escape-parser/src/apc.rs @@ -1219,6 +1219,8 @@ impl Display for KittyImage { #[cfg(test)] mod test { use super::*; + #[cfg(not(feature = "std"))] + use alloc::format; use k9::assert_equal as assert_eq; #[test] diff --git a/wezterm-escape-parser/src/esc.rs b/wezterm-escape-parser/src/esc.rs index b4f20140c..66ee5b13a 100644 --- a/wezterm-escape-parser/src/esc.rs +++ b/wezterm-escape-parser/src/esc.rs @@ -171,6 +171,8 @@ impl Display for Esc { #[cfg(test)] mod test { use super::*; + #[cfg(not(feature = "std"))] + use alloc::format; use alloc::string::String; fn encode(osc: &Esc) -> String { diff --git a/wezterm-escape-parser/src/parser/sixel.rs b/wezterm-escape-parser/src/parser/sixel.rs index 91642346c..d7efd52f9 100644 --- a/wezterm-escape-parser/src/parser/sixel.rs +++ b/wezterm-escape-parser/src/parser/sixel.rs @@ -193,6 +193,8 @@ mod test { use crate::parser::Parser; use crate::{Action, Esc, EscCode}; use alloc::boxed::Box; + #[cfg(not(feature = "std"))] + use alloc::format; use k9::assert_equal as assert_eq; #[test]