Skip to content

Add Rust unit tests and fix cargo test/build linking, wire into CI - #163

Open
nikosavola wants to merge 1 commit into
Isotr0py:mainfrom
nikosavola:rust-tests-ci
Open

Add Rust unit tests and fix cargo test/build linking, wire into CI#163
nikosavola wants to merge 1 commit into
Isotr0py:mainfrom
nikosavola:rust-tests-ci

Conversation

@nikosavola

Copy link
Copy Markdown
  • Stop force-enabling pyo3's extension-module feature in Cargo.toml, since that prevents cargo test/cargo build from linking a real test binary (no libpython). This blocked Rust unit tests from ever running in this crate.
  • Add #[cfg(test)] coverage for extract_boxes (the hand-rolled JXL container box parser, which processes untrusted file bytes) and for ImageInfo::mode/PixelType::color_encoding/has_alpha, none of which had any prior test coverage. Includes edge cases: truncated 64-bit box headers, empty-payload boxes, and every ImageInfo::mode branch.
  • Add a test-rust job to the existing test.yml workflow.

- Stop force-enabling pyo3's extension-module feature in Cargo.toml,
  since that prevents cargo test/cargo build from linking a real test
  binary (no libpython). This blocked Rust unit tests from ever
  running in this crate.
- Add #[cfg(test)] coverage for extract_boxes (the hand-rolled JXL
  container box parser, which processes untrusted file bytes) and for
  ImageInfo::mode/PixelType::color_encoding/has_alpha, none of which had
  any prior test coverage. Includes edge cases: truncated 64-bit box
  headers, empty-payload boxes, and every ImageInfo::mode branch.
- Add a test-rust job to the existing test.yml workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant