feat(testkit): CI guardrails + headless runner for compiler validation#39
Merged
Conversation
Make the emulator a robust firmware/compiler testkit (e.g. for PyMCU) that never flakes or hangs in CI — addressing the classes of problems users hit with rp2040js (infinite-loop/alarm hangs, host-clock non-determinism). - RunUntilHalt(predicate, maxInstructions): a bounded run that cannot hang; returns a diagnostic RunResult (PredicateMet / LockedUp / BudgetReached) so wedged or crashed firmware fails the test with a reason instead of stalling the job. - CPU-health assertions: NotBeLockedUp, NotHaveFaulted, BeInThreadMode, HaveExecutedAtMost(n). - InstructionCount: deterministic, reproducible metric for compiler-size regressions. - rp2040sharp runner CLI (src/RP2040Sharp.Runner): load UF2/bin, run under a hard budget, watch UART/USB-CDC for --expect-text, exit 0 found / 1 not found / 2 crashed. Adds 8 CiGuardsTests (incl. UDF double-fault lockup). 453 unit tests green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The repo moved to https://github.com/PyMCU/RP2040Sharp. Update RepositoryUrl / PackageProjectUrl (embedded in the .nuspec), the README badge/clone URL, and the CHANGELOG compare links. Authorship and publishing stay with begeistert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Description
Makes RP2040Sharp a robust firmware/compiler testkit (e.g. for PyMCU) that never flakes
or hangs in CI, and prepares the repo for the
1.0.0stable release.TestKit CI guardrails
RP2040TestSimulation.RunUntilHalt(predicate, maxInstructions)— a bounded run thatcannot hang; returns a diagnostic
RunResult(PredicateMet/LockedUp/BudgetReached) so wedged or crashed firmware fails the test with a reason instead ofstalling the job.
NotBeLockedUp(),NotHaveFaulted(),BeInThreadMode(),HaveExecutedAtMost(n).InstructionCount— deterministic, reproducible metric for compiler-size regressions.Headless runner CLI (
src/RP2040Sharp.Runner)--expect-text, and exits 0 (found) / 1 (not found) / 2 (crashed). The rp2040js-style--expect-textworkflow, headless. Verified end-to-end againsthello_uart.uf2.Release prep
RepositoryUrl/PackageProjectUrl, README,CHANGELOG links). Still published by
begeistert.1.0.0.Tests: 453 unit + 149 integration, all green. Adds 8
CiGuardsTests(incl. a UDFdouble-fault lockup case). The runner is
IsPackable=false, sodotnet packstill emitsonly
RP2040SharpandRP2040Sharp.TestKit.Type of change
Checklist
dotnet test)Screenshots / Hex Dumps (Optional)
Runner exit codes (verified):