Skip to content

tests: skip fixture-dependent cases without test-suite checkout#316

Merged
mlarouche merged 1 commit into
zigimg:masterfrom
Sim-hu:tests/skip-missing-fixtures
Apr 20, 2026
Merged

tests: skip fixture-dependent cases without test-suite checkout#316
mlarouche merged 1 commit into
zigimg:masterfrom
Sim-hu:tests/skip-missing-fixtures

Conversation

@Sim-hu

@Sim-hu Sim-hu commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add test helpers that convert missing fixture files into error.SkipZigTest
  • use those helpers in tests/image_test.zig and the rotating earth GIF loader
  • keep fixture-dependent tests from failing when ../test-suite/fixtures/ is not checked out

Why

Some tests already treat a missing ../test-suite/fixtures/ checkout as error.SkipZigTest, but a few code paths were still calling the raw image APIs directly. In a plain checkout, that made zig build test fail with FileNotFound instead of skipping those cases.

Validation

  • nix-shell -p zig --run 'zig build test'

@mlarouche

Copy link
Copy Markdown
Collaborator

@Sim-hu Can you update it to latest that uses Zig 0.16.0?

Some tests were still calling raw Image.detectFormatFromFilePath and
zigimg.Image.fromFilePath for fixtures under ../test-suite/fixtures/.
In a plain zigimg checkout those calls return FileNotFound, turning
'zig build test' into a hard failure instead of a skip.

Route them through skip-aware helpers (testDetectFormatFromFilePath
and testImageFromFileWithAllocator) so the fixture-less case is
treated as SkipZigTest, matching the pattern already used for
testImageFromFile/testOpenFile/testReadFile.
@Sim-hu Sim-hu force-pushed the tests/skip-missing-fixtures branch from 60b2475 to 059f3d6 Compare April 20, 2026 03:03
@Sim-hu

Sim-hu commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest master and verified zig build test with Zig 0.16.0 (no test-suite checkout): 337 pass / 160 skip / 0 fail.

@mlarouche mlarouche merged commit c7e81a1 into zigimg:master Apr 20, 2026
3 checks passed
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.

2 participants