Integration tests - #1
Merged
Merged
Conversation
Compiles the real usbcdgadget sources (command handlers, BOT state machine, Update() chunked reads) plus the real cueparser for the build machine against thin stub Circle headers, and drives the gadget exactly like a USB host: CBW in via OnTransferComplete(), data phases and CSW captured from BeginTransfer(), Update() pumped for chunked reads. 34 tests lock in wire-level behavior real hosts depend on, including every Win98-derived fix from the 3.2.x line: medium type per disc (issue danifunker#164), MODE SENSE(10) pad-to-allocation-length, legacy CDB[9] session-info encoding, CSW data residue on short responses, STALL before failing CSW, unit attention gating, READ(10) batching for both USB speeds, and the full MCICDA analog audio sequence including a byte-exact MODE SENSE page 0x0E response from the retail Win98 SE golden trace. Production sources needed two inert accommodations: the ARM cache maintenance asm in tcdstate_update.cpp gained an explicit '#elif AARCH == 32' so the host build compiles (device branches are unchanged), and CUSBCDGadget grew one friend declaration. Runs in CI on ubuntu-latest via .github/workflows/host-tests.yml on any push/PR touching the gadget, cueparser, discimage, or the tests. Found while building the bench: constructing CUSBCDGadget with a device pointer makes SetDevice() delete the device it was just given and keep using the freed pointer. Production always constructs with nullptr (CDROMService::Initialize), so the path is dormant; the bench mirrors production. Worth removing the constructor parameter later. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3BZWQ8DajGvxGtf6BmCYb
macOS's libc++ pulls string.h in transitively, GNU's libstdc++ does not, so scsi_toolbox.cpp failed to find memcpy in CI. Mirror the device, where these arrive through Circle headers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3BZWQ8DajGvxGtf6BmCYb
…erage
Move the host-compiled SCSI/BOT regression suite from test/host into
integration-tests/{harness,test-suite} (per Dani's single-folder request)
and extend it to drive the real disc-image readers against real files.
What is new:
* FatFs host seam (harness/fatfs_host.cpp) plus a FatFsOptimizer stub
(harness/discimage_host.cpp) so the real cuebinfile/chdfile readers
compile and run on the host over stdio, with no reader logic reimplemented.
* Real-image tests (test-suite/test_realimages.cpp): the tracked ISO, a real
FreeDOS ISO9660 + Joliet disc built from genuine FreeDOS 1.3 GPL files,
synthetic and committed CUE/BIN pairs (audio and mixed mode) with byte
exact reads across the 2048 to 2352 track boundary, cue sheets loaded off
the filesystem through the FatFs shim, and a chdman built mixed CHD whose
data and audio tracks decode byte exact through real libchdr.
* Test fixtures under integration-tests/testdata (all free to redistribute:
FreeDOS GPL plus generated content), decompressed by the Makefile at build.
* Stub accuracy and coverage fixes from an independent review: endpoint
transfer/direction enums aligned to Circle, stronger ISO/mixed/CHD oracles.
* CI (host-tests.yml) updated for the new paths and a WITH_CHD run.
Host-only test infrastructure; no firmware behavior changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R3BZWQ8DajGvxGtf6BmCYb
Add a real game data CD (testdata/shareware.iso.gz, volume id SHAREWARE) and a whole-disc readback test. The reader pulls every byte of the ~3.5 MB disc through the real cuebinfile path in an odd-sized chunk (unaligned to the cache window, so refills and cross-window reads are exercised) and compares it byte for byte against the raw file. This stresses a real ISO9660 + Joliet filesystem holding multi-megabyte files spanning many sectors. Contents, both cleared for free redistribution and unmodified: * Descent shareware v1.2 (Parallax Software / Interplay), the freely distributable shareware release as its original installer package. * SkyRoads (Bluemoon Interactive), developer released freeware whose own readme grants free redistribution as an intact single unit. Provenance and licensing are documented on the disc (PROVENANCE.TXT) and in testdata/README-testdata.md. This fixture is isolated in its own commit so it can be dropped if a fully third-party-copyright-free test set is preferred. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3BZWQ8DajGvxGtf6BmCYb
The WITH_CHD step compiles the vendored libchdr, which lives in a git submodule (addon/libchdr-src). actions/checkout does not fetch submodules by default, so the runner was missing libchdr/chd.h and the CHD build failed. Fetch just that submodule, scoped to its path so the large circle-stdlib submodule is not cloned (the host tests do not need it). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3BZWQ8DajGvxGtf6BmCYb
The WITH_CHD build links the vendored zstd. On x86-64 zstd enables an
assembly Huffman decode fast-loop (huf_decompress_amd64.S) that the Makefile
does not assemble, so the link failed with undefined references to
HUF_decompress4X{1,2}_usingDTable_internal_fast_asm_loop. Define
ZSTD_DISABLE_ASM so zstd uses its equivalent portable C decode path. This did
not surface on Apple Silicon, where that assembly path is off already.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R3BZWQ8DajGvxGtf6BmCYb
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.
No description provided.