Skip to content

Regression test harness - #129

Open
willmmiles wants to merge 24 commits into
ESP32Async:mainfrom
willmmiles:harness-v6
Open

willmmiles wants to merge 24 commits into
ESP32Async:mainfrom
willmmiles:harness-v6

Conversation

@willmmiles

Copy link
Copy Markdown

This PR is a regression test harness built principally by @claude . It defines new native and native-asan environments for compiling for the build host, and a suite of LwIP mocks that can be pumped manually by test cases to simulate different event orderings.

The test harness is configured within PlatformIO's framework; it can be run via pio test -e native -e native-asan.

Currently the test harness has 8 failing tests - 6 to do with out-of-memory handling, and 2 with life cycle corner cases that were discovered today. I have prepared a further commit that will add the test suite to the CI, but there's no point in adding it until the whole harness runs green. My preference is to track the failing tests as failing rather than disabling them or marking them as "expected to fail", but if you'd rather go the other way, it can be adjusted.

willmmiles and others added 21 commits October 25, 2026 22:33
A direct cast to uint32_t does not compile where pointers are 64 bits wide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds the library for the host against stand-ins for lwIP, FreeRTOS and the Arduino
core, and runs Unity tests against it with `pio test -e native`.  The lwIP mock plays
the stack: it records every call, accounts for pcbs, pbufs and ports, and invokes the
library's callbacks as lwIP would.  The FreeRTOS mock runs the library's async task on
the test's own thread, so every test is deterministic.  Each test runs in a forked
child.

[env] becomes [target], so that the host environment does not inherit a board and a
framework.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`pio test -e native-asan` runs the same suite under AddressSanitizer and
UndefinedBehaviorSanitizer, with leak detection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unity runs only what RUN_TEST lists, so a test that is written but not listed, or a
file whose run_*_tests() is never called from main, is silently dead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mathieucarbou

Copy link
Copy Markdown
Member

I have prepared a further commit that will add the test suite to the CI, but there's no point in adding it until the whole harness runs green. My preference is to track the failing tests as failing rather than disabling them or marking them as "expected to fail", but if you'd rather go the other way, it can be adjusted.

you can commit the CI update : GitHub will run the new workflow from the branch with the current state and you will see the test failures (providing they are not ignored), and you can mark them ignored to sync with main state and we merge. This would add tests synced with main.

then once merged you can open a new pr with the ignored removed and with the fixes to track the completion ?

willmmiles and others added 3 commits October 27, 2026 15:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Needs no toolchain, so it reports in well under a minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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