mirror of
https://github.com/wezterm/wezterm.git
synced 2026-11-08 01:21:45 +08:00
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.
This commit is contained in:
parent
9ce141d709
commit
e2a98e1b8a
3
.github/workflows/gen_centos9.yml
vendored
3
.github/workflows/gen_centos9.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_centos9_continuous.yml
vendored
3
.github/workflows/gen_centos9_continuous.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_centos9_tag.yml
vendored
3
.github/workflows/gen_centos9_tag.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_debian12.yml
vendored
3
.github/workflows/gen_debian12.yml
vendored
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
3
.github/workflows/gen_debian12_tag.yml
vendored
3
.github/workflows/gen_debian12_tag.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_fedora41.yml
vendored
3
.github/workflows/gen_fedora41.yml
vendored
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
3
.github/workflows/gen_fedora41_tag.yml
vendored
3
.github/workflows/gen_fedora41_tag.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_macos.yml
vendored
3
.github/workflows/gen_macos.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_macos_continuous.yml
vendored
3
.github/workflows/gen_macos_continuous.yml
vendored
@ -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 }}
|
||||
|
||||
3
.github/workflows/gen_macos_tag.yml
vendored
3
.github/workflows/gen_macos_tag.yml
vendored
@ -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 }}
|
||||
|
||||
3
.github/workflows/gen_ubuntu22.04.yml
vendored
3
.github/workflows/gen_ubuntu22.04.yml
vendored
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
3
.github/workflows/gen_ubuntu22.04_tag.yml
vendored
3
.github/workflows/gen_ubuntu22.04_tag.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_ubuntu24.04.yml
vendored
3
.github/workflows/gen_ubuntu24.04.yml
vendored
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
3
.github/workflows/gen_ubuntu24.04_tag.yml
vendored
3
.github/workflows/gen_ubuntu24.04_tag.yml
vendored
@ -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"
|
||||
|
||||
3
.github/workflows/gen_ubuntu26.04.yml
vendored
3
.github/workflows/gen_ubuntu26.04.yml
vendored
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
3
.github/workflows/gen_ubuntu26.04_tag.yml
vendored
3
.github/workflows/gen_ubuntu26.04_tag.yml
vendored
@ -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"
|
||||
|
||||
@ -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 = []
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user