Add a host-native unit test harness - #1266
Open
meeloo wants to merge 1 commit into
Open
Conversation
Takes tests/ from the 3.7-unit-tests branch and fixes the three things that stopped it building here: - RRFLibraries/src/General was on the include path. It holds String.h, which on a case-insensitive filesystem is what libc++'s <cstring> finds when it asks for <string.h>, so every translation unit that reached <cstring> failed. Sources get those headers through the General/ prefix instead. - CXX was assigned unconditionally, so CXX=clang++ on the command line was ignored. Now ?= . - test_fopdt.cpp targets the pre-3.7.0-beta.3 FopDt API and no longer compiles. Excluded with a note rather than guessed at; it needs whoever owns the heater model. Needs the matching RRFLibraries commit that drops the 32-bit unsigned long assertion in SimpleMath.h. make test-host now runs 10 tests green. Note that this reaches leaf utilities only - see tests/README.md for why the motion system is out of reach. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0132JC621uq1434yhpzBNNgJ
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the Duet3D CLA v2.0 and I hereby sign it |
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.
Adds a host-native test harness under
tests/: a small runner, shims for the firmware headers that pull in hardware, and unit tests for a few self-contained pieces (bitmap operations, deviation, FOPDT, integer square root).The point is to be able to exercise pure logic on a development machine without flashing a board. It builds with the system compiler via
tests/Makefileand does not touch the firmware build.One portability fix was needed in RRFLibraries for this to compile on a 64-bit host -
SimpleMath.hhad astatic_assertassuming 32-bitunsigned long. That lives in meeloo/RRFLibraries, branchfeature/host-test-portabilityand would need a matching PR there.Offered rather than proposed: where tests live and how they are run is a maintainer's call, and I have no visibility into whether this duplicates something you already have. Happy to restructure or drop it