Repository navigation
test(tools): round trip between texpack build and the runtime pack reader - #64
Merged
Merged
Conversation
…ader The New 3DS texture pack format is written in Rust and read in C++. CTest now builds two packs from the texpack fixtures with `p3p-texpack build` (RGBA8 and the automatic format) and reads them with the runtime's TexturePack, comparing every texel with the fixture formulas. The test is registered when CMake finds cargo. Verified: CTest 31/31, cargo test 14/14. Removing the row flip in build.rs, moving the RGB565 green bits in pica.rs, and reading the width from the height field in texture_pack.cpp each made the test fail.
On a fresh Linux runner both setup tests ran in parallel and each
installed the pinned Rust toolchain through rustup; rustup's downloads
raced ("could not rename 'downloaded' file") and p3p_texpack_build_auto
failed. A shared RESOURCE_LOCK keeps the two cargo runs sequential.
Verified: CTest -j6 runs them one after another, 31/31 pass.
Owner
Author
|
Linux CI failed in p3p_texpack_build_auto: both round-trip setup tests installed the pinned Rust toolchain through rustup at the same time and rustup's download raced ( |
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The New 3DS texture pack format is written in Rust (
tools/texpack/src/build.rs) and read in C++ (core/src/ge/texture_pack.cpp). This adds a CTest round trip so the two sides can't drift apart unnoticed.p3p_texpack_build_rgba8/p3p_texpack_build_auto(CTest fixture setup) runp3p-texpack buildontools/texpack/tests/fixtures, using the newtextures.inithere: four synthetic images plus a keep-original entry.p3p_texpack_roundtrip(tests/test_texture_pack_roundtrip.cpp) reads both packs with the runtime'sTexturePack. It checks entry count, flags, sizes, format codes and alignment, and compares every texel with the fixture formulas after the format's rules (alpha 0 -> transparent black, truncation, bit expansion).cargo, run fromtools/texpackso the pinned toolchain and build directory apply. Linux CI has cargo; the MSYS2 Windows job skips it.Verified (Windows): CTest 31/31,
cargo test14/14. Three deliberate format changes each made the test fail, then were reverted:build.rs: every RGBA8 texel differs;pica.rs: RGB565 entries differ;texture_pack.cpp: the pack is rejected as invalid.Closes #63